Fix fcollapse require code to work with 64k block size
PATCH 1/1 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 <[email protected]>
--- common/rc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
common/rc +4 -2
@@ -2106,8 +2106,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` + 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
Signature · 1 line
2.9.5