Files
linux-stable-mirror/fs/ext4
Jan Kara b2e294216b ext4: Make sure BH_New bit is cleared in ->write_end handler
[ Upstream commit 91b8ca8b26 ]

Currently we clear BH_New bit in case of error and also in the standard
ext4_write_end() handler (in block_commit_write()). However
ext4_journalled_write_end() misses this clearing and thus we are leaving
stale BH_New bits behind. Generally ext4_block_write_begin() clears
these bits before any harm can be done but in case blocksize < pagesize
and we hit some error when processing a page with these stale bits,
we'll try to zero buffers with these stale BH_New bits and jbd2 will
complain (as buffers were not prepared for writing in this transaction).
Fix the problem by clearing BH_New bits in ext4_journalled_write_end()
and WARN if ext4_block_write_begin() sees stale BH_New bits.

Reported-by: Baolin Liu <liubaolin12138@163.com>
Reported-by: Zhi Long <longzhi@sangfor.com.cn>
Fixes: 3910b513fc ("ext4: persist the new uptodate buffers in ext4_journalled_zero_new_buffers")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250709084831.23876-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-15 12:13:55 +02:00
..
2025-05-29 11:02:15 +02:00
2025-08-01 09:48:45 +01:00
2025-06-27 11:11:20 +01:00
2024-12-05 14:02:41 +01:00
2024-12-05 14:02:41 +01:00
2025-04-20 10:15:42 +02:00
2025-04-20 10:15:20 +02:00