diff options
| author | Zhang Yi <yi.zhang@huawei.com> | 2026-09-03 20:35:38 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2026-10-08 11:11:26 -0400 |
| commit | d8938e95403ed7888b80cb39d7e7e047a493161e (patch) | |
| tree | e26742ddf8c223d1cd691318037b2b99787eced8 /include/uapi/linux/errqueue.h | |
| parent | 4b0d638453ade967e99883d20564c2b0e53dc290 (diff) | |
| download | linux-next-d8938e95403ed7888b80cb39d7e7e047a493161e.tar.gz linux-next-d8938e95403ed7888b80cb39d7e7e047a493161e.zip | |
ext4: clear DISKSIZE_GROW_PENDING on truncate or error
The disksize-grow-pending state is set when a zeroed EOF block is queued
for writeback and cleared by the ioend completion path once writeback
finishes. However, the zeroed block may be discarded before writeback
completes — through folio discard, truncate, or unlink and inode
eviction.
In any of these cases, leaving the bit set would block subsequent
writeback indefinitely. Therefore, we must clear it on all paths that
invalidate the pending block before writeback completes:
- ext4_iomap_discard_folio() on folio discard.
- ext4_evict_inode() when an unlinked inode is destroyed.
In ext4_truncate_down(), truncating past the pending zeroed EOF block
also invalidates the pending disksize update, so the bit must be cleared
there as well.
Finally, add a WARN_ON in ext4_destroy_inode() to catch any inode
destroyed with the bit still set. The check is skipped when the
filesystem is in an error or emergency state, as the pending block may
not have been written back in those cases.
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-27-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
