]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ext4: ensure zeroed partial blocks are persisted in SYNC mode
authorZhang Yi <yi.zhang@huawei.com>
Fri, 27 Mar 2026 10:29:35 +0000 (18:29 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 10 Apr 2026 01:57:52 +0000 (21:57 -0400)
commit7d81ec0246ff74b10d92a4617fea84eaf06162c0
tree0adfaf2247b6e11356b7ebb8824d43a6fa751c29
parentc4602a1d09ec7c6dd6f53e5faf3f04e9c02d71eb
ext4: ensure zeroed partial blocks are persisted in SYNC mode

In ext4_zero_range() and ext4_punch_hole(), when operating in SYNC mode
and zeroing a partial block, only data=journal modes guarantee that the
zeroed data is synchronously persisted after the operation completes.
For data=ordered/writeback mode and non-journal modes, this guarantee is
missing.

Introduce a partial_zero parameter to explicitly trigger writeback for
all scenarios where a partial block is zeroed, ensuring the zeroed data
is durably persisted.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20260327102939.1095257-10-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/extents.c
fs/ext4/inode.c