yamt commented on PR #2913:
URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2777379683

   > > Any reason there isn't a sync in 
[`littlefs_truncate`](https://github.com/apache/nuttx/blob/90e9b2426d54682070b0fcc38ad5415bbf77f733/fs/littlefs/lfs_vfs.c#L929),
   > 
   > good idea, patch is welcome.
   
   i agree it's a good idea to make O_TRUNC and truncate consistent.
   i don't think it's a good idea to make this hack in the first place though.
   it's better to leave it to user applications.
   my suggestion is to revert this PR to make it consistent.
   
   > > then? The woraround for users like me is to open the file without 
`O_TRUNC` and then call `truncate` to ensure no commit.
   > 
   > but, the sync still need in open to ensure the truncate take effect 
immediately, but the sync could be called only when O_TRUNC is specified.
   
   a user application which needs the behavior can call fsync by itself.
   


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