diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-10-09 18:30:26 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-10-15 10:53:13 -0400 |
| commit | 09e4d8701614d2c524d96a88c4ff694f42b9a180 (patch) | |
| tree | d3df28bf4977f93d69de336f936823bd3a26c68c /scripts/Makefile.thinlto | |
| parent | ee6539fc9eb0f156652c6a8710e5db1dca56ecc3 (diff) | |
| download | linux-09e4d8701614d2c524d96a88c4ff694f42b9a180.tar.gz linux-09e4d8701614d2c524d96a88c4ff694f42b9a180.zip | |
ext4: submit and wait for disksize-grow I/O in fallocate paths
Collapse range and insert range update i_disksize directly under
i_data_sem. If the operation runs while the zeroed EOF block is still
awaiting writeback, i_disksize could advance past the zeroed boundary
before the zeroed data is persisted, exposing stale data on crash.
Deferring i_disksize updates like fallocate and zero_range is not an
option here because the shift would move written extents beyond the
current i_disksize. So flush and wait for the pending zeroed EOF block
before these operations advance i_disksize. Since these operations
already perform writeback, the extra flush does not add significant
overhead.
In addition, for ext4_update_disksize_before_punch(), if the punch
discards the pending block, the zeroed data will never be written back
before advancing i_disksize, so it is also necessary to sync the
pending EOF range there.
Finally, for the SYNC variants of zero_range and fallocate, this also
guarantees the i_disksize update is persisted on the synchronous
return.
Note that EXT4_STATE_DISKSIZE_GROW_PENDING is not set for now, and it
will be set after everything is done.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Tested-by: syzbot@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20261009103033.2920530-26-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
