arnavsharma990 commented on code in PR #21391:
URL: https://github.com/apache/nuttx/pull/21391#discussion_r4489472143


##########
fs/fat/fs_fat32.c:
##########
@@ -126,6 +136,46 @@ static int     fat_stat_root(FAR struct fat_mountpt_s *fs,
 static int     fat_stat(struct inode *mountpt, const char *relpath,
                  FAR struct stat *buf);
 
+#ifdef CONFIG_FS_FAT_READONLY
+static int fat_sync(FAR struct file *filep)

Review Comment:
   the sync stub is intentional. with `sync` set to `NULL`, `fsync()` on a read 
only FAT file returns `-EINVAL` (see `fs/vfs/fs_fsync.c`), whereas without this 
option it returns `OK`.
   
   since read only mode does not allow filesystem modifications , there is 
nothing to flush. Keeping a no-op `fat_sync()` preserves the existing 
successful `fsync()` behavior for read only FAT files without performing any 
filesystem writes.



-- 
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