summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorZhang Yi <yi.zhang@huawei.com>2026-10-09 18:30:28 +0800
committerTheodore Ts'o <tytso@mit.edu>2026-10-15 10:53:14 -0400
commite766cff471218142abfb0fba2ad3b16bbecce833 (patch)
tree21c71dd7ecce157aff4dade4b247004193701ab0 /include/trace
parent2309d96c93ce5c4eb243757eb6b5805fb57d831f (diff)
ext4: set DISKSIZE_GROW_PENDING after zeroing unaligned EOF block
In the iomap buffered I/O path, data=ordered mode is not used, so the zeroed EOF block has no implicit ordering with later i_disksize updates. Without the pending state being set, i_disksize can be advanced past the zeroed block before writeback completes, exposing stale data after a crash. Previous patches added the consumer side of the disksize-grow-pending mechanism: the state bit, clear and wait helpers, and ioend tagging. Now add ext4_iomap_mark_disksize_pending() and call it from ext4_block_zero_eof() after zeroing the tail of the block that straddles i_disksize. The helper locks the folio, waits for any in-flight writeback on it to complete, then sets EXT4_STATE_DISKSIZE_GROW_PENDING only if the folio is still dirty. Waiting for writeback prevents folio_test_dirty() from returning false mid-writeback, which would cause us to skip the pending state while zeroed data is still in flight. The dirty check then avoids setting the bit when the data has already been written back. Suggested-by: Jan Kara <jack@suse.cz> Signed-off-by: Zhang Yi <yi.zhang@huawei.com> Tested-by: syzbot@syzkaller.appspotmail.com Link: https://patch.msgid.link/20261009103033.2920530-28-yi.zhang@huaweicloud.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/trace')
0 files changed, 0 insertions, 0 deletions