* Re: [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file [not found] <5de3d9c8-e847-422f-a9e4-31ac2a1b5c2e@amlogic.com> @ 2026-09-07 7:08 ` Chao Yu via Linux-f2fs-devel 2026-09-07 8:45 ` Jiucheng Xu via Linux-f2fs-devel 0 siblings, 1 reply; 3+ messages in thread From: Chao Yu via Linux-f2fs-devel @ 2026-09-07 7:08 UTC (permalink / raw) To: Jiucheng Xu, Jaegeuk Kim; +Cc: linux-f2fs-devel On 9/2/26 11:18, Jiucheng Xu wrote: > Hi f2fs maintainers, Jiucheng, Sorry for delay reply. > > Gentle ping for this patch: > Link: https://lore.kernel.org/r/20260826-origin-dev-v1-1-c21271a82100@amlogic.com > > For compressed file, compressed write may fail and fall back to raw > write. > If in-place update(IPU) is allowed, raw data could be written into disk > before cluster metadata is updated from compressed state to raw state. > Sudden power-cut during this window will result in inconsistency: > raw data on disk but metadata still expects compressed content, > which causes decompression failure when reading the file later. I didn't get it, can you please describe the issue w/ call stack in race condition? > > To eliminate this risk completely, force out-place update for all > write operations on compressed file, so IPU will never be used. > > Could you please take a look at your convenience? > Any comments are welcome. > > Thanks, > Jiucheng > _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file 2026-09-07 7:08 ` [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file Chao Yu via Linux-f2fs-devel @ 2026-09-07 8:45 ` Jiucheng Xu via Linux-f2fs-devel 2026-09-07 10:38 ` Chao Yu via Linux-f2fs-devel 0 siblings, 1 reply; 3+ messages in thread From: Jiucheng Xu via Linux-f2fs-devel @ 2026-09-07 8:45 UTC (permalink / raw) To: Chao Yu, Jaegeuk Kim; +Cc: linux-f2fs-devel On 9/7/2026 3:08 PM, Chao Yu wrote: > [ EXTERNAL EMAIL ] > > On 9/2/26 11:18, Jiucheng Xu wrote: > > Jiucheng, > > Sorry for delay reply. > > > I didn't get it, can you please describe the issue w/ call stack in race > condition? > Hi Chao, Thanks for your time, The call stack is shown as below: -Thread A - Thread B - f2fs_write_multi_pages - f2fs_down_write(&sbi->cp_rwsem); - f2fs_write_compressed_pages - ... - f2fs_trylock_op - ... - f2fs_down_read_trylock(&sbi->cp_rwsem); - ... - f2fs_write_raw_pages - ... Thread B acquires the lock first, which causes Thread A to fail lock acquisition and fall back to raw‑data write. IPU_FORCE is enabled on 16G eMMC platforms, so f2fs_write_raw_pages() overwrites the original compressed data in‑place. The in‑memory node has been updated with raw‑data addresses, while the node metadata stored on eMMC still remains in compressed state. If a power‑cut occurs before the node is flushed to disk, on‑disk inconsistency arises: The data on disk is raw, but metadata still treats it as a compressed cluster and decompression will fail. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file 2026-09-07 8:45 ` Jiucheng Xu via Linux-f2fs-devel @ 2026-09-07 10:38 ` Chao Yu via Linux-f2fs-devel 0 siblings, 0 replies; 3+ messages in thread From: Chao Yu via Linux-f2fs-devel @ 2026-09-07 10:38 UTC (permalink / raw) To: Jiucheng Xu, Jaegeuk Kim; +Cc: linux-f2fs-devel On 9/7/26 16:45, Jiucheng Xu wrote: > On 9/7/2026 3:08 PM, Chao Yu wrote: >> [ EXTERNAL EMAIL ] >> >> On 9/2/26 11:18, Jiucheng Xu wrote: >> >> Jiucheng, >> >> Sorry for delay reply. >> >> >> I didn't get it, can you please describe the issue w/ call stack in race >> condition? >> > Hi Chao, > > Thanks for your time, The call stack is shown as below: > > -Thread A - Thread B > - f2fs_write_multi_pages - > f2fs_down_write(&sbi->cp_rwsem); > - f2fs_write_compressed_pages - ... > - f2fs_trylock_op - ... > - f2fs_down_read_trylock(&sbi->cp_rwsem); - ... > - f2fs_write_raw_pages - ... > > Thread B acquires the lock first, which causes Thread A to fail lock > acquisition and fall back to raw‑data write. > IPU_FORCE is enabled on 16G eMMC platforms, so f2fs_write_raw_pages() > overwrites the original compressed data in‑place. > The in‑memory node has been updated with raw‑data addresses, while the > node metadata stored on eMMC still remains in compressed state. > If a power‑cut occurs before the node is flushed to disk, on‑disk > inconsistency arises: The data on disk is raw, but metadata > still treats it as a compressed cluster and decompression will fail. Ah, now, I see, thanks for your explanation, can you add above callstack in commit message as well? Thanks, _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-07 10:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <5de3d9c8-e847-422f-a9e4-31ac2a1b5c2e@amlogic.com>
2026-09-07 7:08 ` [f2fs-dev] [PING][PATCH] f2fs: force out‑place update for all writes on compressed file Chao Yu via Linux-f2fs-devel
2026-09-07 8:45 ` Jiucheng Xu via Linux-f2fs-devel
2026-09-07 10:38 ` Chao Yu via Linux-f2fs-devel
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.