summaryrefslogtreecommitdiff
path: root/common/punch
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2022-07-19 14:37:50 -0700
committerZorro Lang <zlang@kernel.org>2022-07-24 22:30:58 +0800
commitce205e9a4a962a5636d1ce9175d0786cf43abaf2 (patch)
tree3a23ca2d1d199b8ec25a6eb6bcdd7a4918b94560 /common/punch
parenta4acb097a6d1faa484918ea236b6eb437a3ee4cd (diff)
punch: skip fpunch tests when op length not congruent with file allocation unit
Skip the generic fpunch tests on a file when the file's allocation unit size is not congruent with the proposed testing operations. This can be the case when we're testing reflink and fallocate on the XFS realtime device. For those configurations, the file allocation unit is a realtime extent, which can be any integer multiple of the block size. If the request length isn't an exact multiple of the allocation unit size, reflink and fallocate will fail due to alignment issues, so there's no point in running these tests. Assuming this edgecase configuration of an edgecase feature is vanishingly rare, let's just _notrun the tests instead of rewriting a ton of tests to do their integrity checking by hand. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Reviewed-by: Zorro Lang <zlang@redhat.com> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common/punch')
-rw-r--r--common/punch1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/punch b/common/punch
index 4d16b898..47a29c92 100644
--- a/common/punch
+++ b/common/punch
@@ -250,6 +250,7 @@ _test_generic_punch()
_8k="$((multiple * 8))k"
_12k="$((multiple * 12))k"
_20k="$((multiple * 20))k"
+ _require_congruent_file_oplen "$(dirname "$testfile")" $((multiple * 4096))
# initial test state must be defined, otherwise the first test can fail
# due ot stale file state left from previous tests.