Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-10 Thread via GitHub
yamt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2791477503 > > > > > Any reason there isn't a sync in [`littlefs_truncate`](https://github.com/apache/nuttx/blob/90e9b2426d54682070b0fcc38ad5415bbf77f733/fs/littlefs/lfs_vfs.c#L929), > > > > > > >

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-09 Thread via GitHub
liamHowatt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2791608100 For some reason I did not notice that it syncs for all opens, not just O_TRUNC opens. The current code comment made my eyes see a `if (oflags & LFS_O_TRUNC)`, but there isn't. -- This

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-05 Thread via GitHub
yamt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2774250147 > > @xiaoxiang781216 can you explain > > > > * why O_TRUNC should be immediately committed > > If the storage is near exhausted, the next write will fail without commit. is

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-05 Thread via GitHub
xiaoxiang781216 commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2774226026 > @xiaoxiang781216 can you explain > > * why O_TRUNC should be immediately committed If the storage is near exhausted, the next write will fail without commit. >

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-04 Thread via GitHub
yamt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2780186256 > > > > Any reason there isn't a sync in [`littlefs_truncate`](https://github.com/apache/nuttx/blob/90e9b2426d54682070b0fcc38ad5415bbf77f733/fs/littlefs/lfs_vfs.c#L929), > > > > > >

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-04 Thread via GitHub
xiaoxiang781216 commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2780170759 > > > Any reason there isn't a sync in [`littlefs_truncate`](https://github.com/apache/nuttx/blob/90e9b2426d54682070b0fcc38ad5415bbf77f733/fs/littlefs/lfs_vfs.c#L929), > > > >

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-03 Thread via GitHub
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

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-03 Thread via GitHub
xiaoxiang781216 commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2775614932 > 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,

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-03 Thread via GitHub
liamHowatt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2774961465 Any reason there isn't a sync in [`littlefs_truncate`](https://github.com/apache/nuttx/blob/90e9b2426d54682070b0fcc38ad5415bbf77f733/fs/littlefs/lfs_vfs.c#L929), then? The woraround for

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-02 Thread via GitHub
yamt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2774437272 > > > > @xiaoxiang781216 can you explain > > > > > > > > * why O_TRUNC should be immediately committed > > > > > > > > > If the storage is near exhausted, the next write will f

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-02 Thread via GitHub
xiaoxiang781216 commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2774411385 > > > @xiaoxiang781216 can you explain > > > > > > * why O_TRUNC should be immediately committed > > > > > > If the storage is near exhausted, the next write will fa

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-02 Thread via GitHub
yamt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2774137541 @xiaoxiang781216 can you explain * why O_TRUNC should be immediately committed * why you don't need to check errors from lfs_file_sync * why this needs to be fixed here (not in litt

Re: [PR] fs/lfs: lfs_file_sync() when littlefs_open [nuttx]

2025-04-02 Thread via GitHub
liamHowatt commented on PR #2913: URL: https://github.com/apache/nuttx/pull/2913#issuecomment-2773686018 I think it goes against user expectations. A user reading and rewriting a file in a context where power can fail could find the file empty after a power-up. LittleFS is advertised as mai