linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] ext4: fix an data corruption issue in nojournal mode
@ 2025-09-16  9:33 Zhang Yi
  2025-09-16  9:33 ` [PATCH 1/2] jbd2: ensure that all ongoing I/O complete before freeing blocks Zhang Yi
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Zhang Yi @ 2025-09-16  9:33 UTC (permalink / raw)
  To: linux-ext4
  Cc: linux-fsdevel, linux-kernel, tytso, adilger.kernel, jack,
	hsiangkao, yi.zhang, yi.zhang, libaokun1, yukuai3, yangerkun

From: Zhang Yi <yi.zhang@huawei.com>

Hello!

This series fixes an data corruption issue reported by Gao Xiang in
nojournal mode. The problem is happened after a metadata block is freed,
it can be immediately reallocated as a data block. However, the metadata
on this block may still be in the process of being written back, which
means the new data in this block could potentially be overwritten by the
stale metadata and trigger a data corruption issue. Please see below
discussion with Jan for more details:

  https://lore.kernel.org/linux-ext4/a9417096-9549-4441-9878-b1955b899b4e@huaweicloud.com/

Patch 1 strengthens the same case in ordered journal mode, theoretically
preventing the occurrence of stale data issues. 
Patch 2 fix this issue in nojournal mode.

Regards,
Yi.

Zhang Yi (2):
  jbd2: ensure that all ongoing I/O complete before freeing blocks
  ext4: wait for ongoing I/O to complete before freeing blocks

 fs/ext4/ext4_jbd2.c   | 11 +++++++++--
 fs/jbd2/transaction.c | 13 +++++++++----
 2 files changed, 18 insertions(+), 6 deletions(-)

-- 
2.46.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-10-15  2:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-16  9:33 [PATCH 0/2] ext4: fix an data corruption issue in nojournal mode Zhang Yi
2025-09-16  9:33 ` [PATCH 1/2] jbd2: ensure that all ongoing I/O complete before freeing blocks Zhang Yi
2025-09-16 10:56   ` Jan Kara
2025-09-16  9:33 ` [PATCH 2/2] ext4: wait for ongoing I/O to " Zhang Yi
2025-09-16 10:57   ` Jan Kara
2025-10-02 11:42 ` [PATCH 0/2] ext4: fix an data corruption issue in nojournal mode Gao Xiang
2025-10-06 13:52   ` Jan Kara
2025-10-06 14:37     ` Gao Xiang
2025-10-09 14:58     ` Theodore Ts'o
2025-10-15  2:44 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).