[PATCH 17/19] jbd2: assert on a failed write, not on a buffer that is not up to date
From: Chao Shi
Date: Sat Aug 01 2026 - 18:04:26 EST
jbd2_freeze_jh_data() asserts that the buffer it is about to copy out is up
to date. Once this series stops clearing BH_Uptodate on write error, that
assertion stops firing for the case it was written for, because a buffer
whose write failed stays up to date - which is the point: the in-memory
copy being frozen is still the data the filesystem wants written.
Assert on the condition that still means something went wrong. The message
loses its "Possible", because BH_Write_EIO is not a guess.
Suggested-by: Jan Kara <jack@xxxxxxx>
Signed-off-by: Chao Shi <coshi036@xxxxxxxxx>
---
fs/jbd2/transaction.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 5cc7d097b2ac..fdabe34a7e22 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -920,7 +920,7 @@ static void jbd2_freeze_jh_data(struct journal_head *jh)
char *source;
struct buffer_head *bh = jh2bh(jh);
- J_EXPECT_JH(jh, buffer_uptodate(bh), "Possible IO failure.\n");
+ J_EXPECT_JH(jh, !buffer_write_io_error(bh), "IO failure.\n");
source = kmap_local_folio(bh->b_folio, bh_offset(bh));
/* Fire data frozen trigger just before we copy the data */
jbd2_buffer_frozen_trigger(jh, source, jh->b_triggers);
--
2.43.0