diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-09-03 20:35:37 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-10-08 11:11:26 -0400 |
| commit | 4b0d638453ade967e99883d20564c2b0e53dc290 (patch) | |
| tree | d6b44279b27ed1a9eae6a0202ebb24e56b906298 /include/uapi/linux/errqueue.h | |
| parent | dce8729e91d2b967574a94e2636adbbb97dea44f (diff) | |
| download | linux-next-4b0d638453ade967e99883d20564c2b0e53dc290.tar.gz linux-next-4b0d638453ade967e99883d20564c2b0e53dc290.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 everthing is done.
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20260903123543.2302999-26-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include/uapi/linux/errqueue.h')
0 files changed, 0 insertions, 0 deletions
