* tests/cp/sparse-perf.sh: On file systems without SEEK_HOLE support,
this test would confusingly partially fail before being skipped.
---
tests/cp/sparse-perf.sh | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/tests/cp/sparse-perf.sh b/tests/cp/sparse-perf.sh
index 3908958e9..2f3da646c 100755
--- a/tests/cp/sparse-perf.sh
+++ b/tests/cp/sparse-perf.sh
@@ -29,14 +29,15 @@ other_partition_sparse=$other_partition_tmpdir/k
printf x > $other_partition_sparse || framework_failure_
truncate -s1M $other_partition_sparse || framework_failure_
-# cp should not disable anything by default, even for sparse files. For e.g.
-# copy offload is an important performance improvement for sparse files on NFS.
+# With SEEK_HOLE, cp should not avoid copy offload for sparse files.
+# This is an important performance improvement for sparse files on NFS.
+# Note without SEEK_HOLE copy offload may allocate holes, so is avoided.
cp --debug $other_partition_sparse k2 >cp.out 2>cp.err; ret=$?
# Old Centos 7 or WSL 1 can give EINVAL erroneously
grep -F "$EINVAL" cp.err && skip_ 'received EINVAL when copying sparse file'
test "$ret" = 0 || { cat cp.err >&2; fail=1; }
cmp $other_partition_sparse k2 || fail=1
-grep ': avoided' cp.out && { cat cp.out; fail=1; }
+grep ': avoided.*SEEK_HOLE' cp.out && { cat cp.out; fail=1; }
# Create a large-non-sparse-but-compressible file
@@ -47,7 +48,7 @@ mls='might-look-sparse'
yes | head -n1M > "$mls" || framework_failure_
cp --debug "$mls" "$mls.cp" >cp.out || fail=1
cmp "$mls" "$mls.cp" || fail=1
-grep ': avoided' cp.out && { cat cp.out; fail=1; }
+grep ': avoided.*SEEK_HOLE' cp.out && { cat cp.out; fail=1; }
# Create a large-but-sparse file on the current partition.
--
2.55.0