aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandan Rajendra <chandan@linux.vnet.ibm.com>2018-02-22 11:28:55 +0530
committerEryu Guan <eguan@redhat.com>2018-02-22 16:12:12 +0800
commit6702176b93404db6efc1ed6ea8ac4075df2f949f (patch)
treead059b20304535127967b14b02bd90c21839b3c7
parentb8b56f24d917fef2ab8400a7bc645844cbd777d6 (diff)
downloadxfstests-dev-6702176b93404db6efc1ed6ea8ac4075df2f949f.tar.gz
common/rc: Fix fcollapse require code to work with 64k block size
For 64k block size, the require code fails because the block range [4k, 12k] would cause the fcollapse syscall to return -EINVAL. Hence the tests using them are not executed. This commit fixes the issue by calculating file offset ranges based on the block size of the underlying filesystem. Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com> Reviewed-by: Eryu Guan <eguan@redhat.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rw-r--r--common/rc6
1 files changed, 4 insertions, 2 deletions
diff --git a/common/rc b/common/rc
index 51dc9f7628..a68e6cc0d9 100644
--- a/common/rc
+++ b/common/rc
@@ -2113,8 +2113,10 @@ _require_xfs_io_command()
param_checked=1
;;
"fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" | "funshare")
- testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \
- -c "$command 4k 8k" $testfile 2>&1`
+ local blocksize=$(_get_block_size $TEST_DIR)
+ testio=`$XFS_IO_PROG -F -f -c "pwrite 0 $((5 * $blocksize))" \
+ -c "fsync" -c "$command $blocksize $((2 * $blocksize))" \
+ $testfile 2>&1`
;;
"fiemap")
# If 'ranged' is passed as argument then we check to see if fiemap supports