xiaoxiang781216 commented on code in PR #19126:
URL: https://github.com/apache/nuttx/pull/19126#discussion_r3413307060


##########
fs/littlefs/lfs_vfs.c:
##########
@@ -1415,6 +1419,40 @@ static int littlefs_bind(FAR struct inode *driver, FAR 
const void *data,
       goto errout_with_fs;
     }
 
+  /* Parse comma-separated mount options. Recognised tokens:
+   *   autoformat           - format if mount fails
+   *   forceformat          - always format before mounting
+   *   block_size_factor=N  - override CONFIG_FS_LITTLEFS_BLOCK_SIZE_FACTOR
+   */
+
+  if (data != NULL)
+    {
+      FAR const char *p = data;
+
+      while (*p != '\0')
+        {
+          FAR const char *end = strchrnul(p, ',');
+          size_t len = end - p;
+
+          if (len == sizeof("autoformat") - 1 &&

Review Comment:
   remove the len check



##########
fs/littlefs/lfs_vfs.c:
##########
@@ -1415,6 +1419,40 @@ static int littlefs_bind(FAR struct inode *driver, FAR 
const void *data,
       goto errout_with_fs;
     }
 
+  /* Parse comma-separated mount options. Recognised tokens:
+   *   autoformat           - format if mount fails
+   *   forceformat          - always format before mounting
+   *   block_size_factor=N  - override CONFIG_FS_LITTLEFS_BLOCK_SIZE_FACTOR
+   */
+
+  if (data != NULL)
+    {
+      FAR const char *p = data;
+
+      while (*p != '\0')
+        {
+          FAR const char *end = strchrnul(p, ',');
+          size_t len = end - p;
+
+          if (len == sizeof("autoformat") - 1 &&
+              strncmp(p, "autoformat", len) == 0)
+            {
+              autoformat = true;
+            }
+          else if (len == sizeof("forceformat") - 1 &&

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to