yamt commented on code in PR #15945:
URL: https://github.com/apache/nuttx/pull/15945#discussion_r2022099888


##########
fs/littlefs/lfs_vfs.c:
##########
@@ -1168,6 +1162,11 @@ static int littlefs_write_block(FAR const struct 
lfs_config *c,
   FAR struct inode *drv = fs->drv;
   int ret;
 
+  if (fs->readonly)
+    {
+      return -EACCES;
+    }

Review Comment:
   are you confident littlefs always handles this error in a way a user usually 
expects for a read-only mounted filesystem? i think it doesn't. eg. when a 
write gets delayed to close/sync
   i suspect you should reject write attempts in the upper layer. (eg. 
littlefs_open, littlefs_write etc. or, even fs/vfs.)
   
   also, the usual error for read-only mounted filesystem is EROFS, not EACCES.
   



-- 
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: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to