]> git.ipfire.org Git - thirdparty/linux.git/commit
ext4: subdivide EXT4_EXT_DATA_VALID1
authorZhang Yi <yi.zhang@huawei.com>
Sat, 29 Nov 2025 10:32:33 +0000 (18:32 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 18 Jan 2026 16:23:33 +0000 (11:23 -0500)
commit22784ca541c0f01c5ebad14e8228298dc0a390ed
tree148f1e6263bd844a158903e4ab05a53d853d50eb
parentd250bdf531d9cd4096fedbb9f172bb2ca660c868
ext4: subdivide EXT4_EXT_DATA_VALID1

When splitting an extent, if the EXT4_GET_BLOCKS_CONVERT flag is set and
it is necessary to split the target extent in the middle,
ext4_split_extent() first handles splitting the latter half of the
extent and passes the EXT4_EXT_DATA_VALID1 flag. This flag implies that
all blocks before the split point contain valid data; however, this
assumption is incorrect.

Therefore, subdivid EXT4_EXT_DATA_VALID1 into
EXT4_EXT_DATA_ENTIRE_VALID1 and EXT4_EXT_DATA_PARTIAL_VALID1, which
indicate that the first half of the extent is either entirely valid or
only partially valid, respectively. These two flags cannot be set
simultaneously.

This patch does not use EXT4_EXT_DATA_PARTIAL_VALID1, it only replaces
EXT4_EXT_DATA_VALID1 with EXT4_EXT_DATA_ENTIRE_VALID1 at the location
where it is set, no logical changes.

Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Baokun Li <libaokun1@huawei.com>
Cc: stable@kernel.org
Message-ID: <20251129103247.686136-2-yi.zhang@huaweicloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents.c