]> git.ipfire.org Git - thirdparty/linux.git/commit
et4: allow zeroout when doing written to unwritten split
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Fri, 23 Jan 2026 06:25:39 +0000 (11:55 +0530)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 23 Jan 2026 21:50:11 +0000 (16:50 -0500)
commit4f5e8e6f012349a107531b02eed5b5ace6181449
treecc61d6a89d8cbad3470541a903638b3034684524
parent716b9c23b86240d419a43c1f211c628ac04acb8f
et4: allow zeroout when doing written to unwritten split

Currently, when we are doing an extent split and convert operation of
written to unwritten extent (example, as done by ZERO_RANGE), we don't
allow the zeroout fallback in case the extent tree manipulation fails.
This is mostly because zeroout might take unsually long and the fact that
this code path is more tolerant to failures than endio.

Since we have zeroout machinery in place, we might as well use it hence
lift this restriction. To mitigate zeroout taking too long respect the
max zeroout limit here so that the operation finishes relatively fast.

Also, add kunit tests for this case.

Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://patch.msgid.link/1c3349020b8e098a63f293b84bc8a9b56011cef4.1769149131.git.ojaswin@linux.ibm.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/extents-test.c
fs/ext4/extents.c