diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-10-09 18:30:12 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-10-15 10:53:12 -0400 |
| commit | 935442e001c2570e738cad776662d1c0558cbb52 (patch) | |
| tree | 3d0228dd95ca991d5ef6936ce1ae89b656b95b67 /scripts/Makefile.thinlto | |
| parent | 331838d93b65f4bcac2ffec8e3da639847fa241c (diff) | |
| download | linux-935442e001c2570e738cad776662d1c0558cbb52.tar.gz linux-935442e001c2570e738cad776662d1c0558cbb52.zip | |
ext4: pass out extent seq counter when mapping da blocks
The iomap buffered write path does not hold the folio lock between
mapping the inode extent and copying data. Therefore, it can race
with writeback that modifies the extent type (e.g., from unwritten to
written). This can lead to data corruption on partial writes, as
iomap_block_needs_zeroing() may return a false positive based on a
stale extent. The iomap infrastructure uses the sequence counter
stored in the inode to detect such stale mappings.
Commit 07c440e8da8f ("ext4: pass out extent seq counter when mapping
blocks") added the m_seq field to ext4_map_blocks to pass out extent
sequence numbers, but it missed two callsites within
ext4_da_map_blocks(). These callsites are on the delayed allocation
path, which is needed in the iomap buffered write path. Pass out the
sequence counter to ensure stale mappings can be detected.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Tested-by: syzbot@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20261009103033.2920530-12-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
