]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
generic/562: handle ENOSPC while cloning gracefully
authorDarrick J. Wong <djwong@kernel.org>
Tue, 26 Nov 2024 01:22:05 +0000 (17:22 -0800)
committerZorro Lang <zlang@kernel.org>
Thu, 28 Nov 2024 13:39:49 +0000 (21:39 +0800)
commit93a8e88d0f6ed506dfed281d6914c59a5b85b115
tree13a95c82be2eef83b160f37f63a7e679ccdf29bc
parent67e01fc52bbc2101f8ce2dcc7298716ffbc4e990
generic/562: handle ENOSPC while cloning gracefully

This test creates a couple of patterned files on a tiny filesystem,
fragments the free space, clones one patterned file to the other, and
checks that the entire file was cloned.

However, this test doesn't work on a 64k fsblock filesystem because
we've used up all the free space reservation for the rmapbt, and that
causes the FICLONE to error out with ENOSPC partway through.  Hence we
need to detect the ENOSPC and _notrun the test.

That said, it turns out that XFS has been silently dropping error codes
if we managed to make some progress cloning extents.  That's ok if the
operation has REMAP_FILE_CAN_SHORTEN like copy_file_range does, but
FICLONE/FICLONERANGE do not permit partial results, so the dropped error
codes is actually an error.

Therefore, this testcase now becomes a regression test for the patch to
fix that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/562