From: Darrick J. Wong <djwong@xxxxxxxxxx> Tests that exercise block remapping functionality such as reflink, hole punching, fcollapse, and finsert all require the input parameters to be aligned to allocation unit size for regular files. This could be different from the fundamental filesystem block size (think ext4 bigalloc or xfs realtime), so use the appropriate function here. Signed-off-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- common/rc | 2 +- tests/generic/017 | 2 +- tests/generic/064 | 2 +- tests/generic/158 | 2 +- tests/xfs/537 | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/rc b/common/rc index d5e6764c..5bac0355 100644 --- a/common/rc +++ b/common/rc @@ -2626,7 +2626,7 @@ _require_xfs_io_command() param_checked="$param" ;; "fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" | "funshare") - local blocksize=$(_get_block_size $TEST_DIR) + local blocksize=$(_get_file_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` diff --git a/tests/generic/017 b/tests/generic/017 index 4b6acace..12c486d1 100755 --- a/tests/generic/017 +++ b/tests/generic/017 @@ -29,7 +29,7 @@ _scratch_mount testfile=$SCRATCH_MNT/$seq.$$ BLOCKS=10240 -BSIZE=`_get_block_size $SCRATCH_MNT` +BSIZE=`_get_file_block_size $SCRATCH_MNT` length=$(($BLOCKS * $BSIZE)) diff --git a/tests/generic/064 b/tests/generic/064 index b7d7fa4b..3b32fa1b 100755 --- a/tests/generic/064 +++ b/tests/generic/064 @@ -29,7 +29,7 @@ _scratch_mount src=$SCRATCH_MNT/testfile dest=$SCRATCH_MNT/testfile.dest BLOCKS=100 -BSIZE=`_get_block_size $SCRATCH_MNT` +BSIZE=`_get_file_block_size $SCRATCH_MNT` length=$(($BLOCKS * $BSIZE)) # Write file diff --git a/tests/generic/158 b/tests/generic/158 index 649c75db..b9955265 100755 --- a/tests/generic/158 +++ b/tests/generic/158 @@ -38,7 +38,7 @@ testdir2=$SCRATCH_MNT/test-$seq mkdir $testdir2 echo "Create the original files" -blksz="$(_get_block_size $testdir1)" +blksz="$(_get_file_block_size $testdir1)" blks=1000 margin='7%' sz=$((blksz * blks)) diff --git a/tests/xfs/537 b/tests/xfs/537 index 7d7776f7..a31652cd 100755 --- a/tests/xfs/537 +++ b/tests/xfs/537 @@ -29,7 +29,7 @@ echo "Format and mount fs" _scratch_mkfs >> $seqres.full _scratch_mount >> $seqres.full -bsize=$(_get_block_size $SCRATCH_MNT) +bsize=$(_get_file_block_size $SCRATCH_MNT) srcfile=${SCRATCH_MNT}/srcfile donorfile=${SCRATCH_MNT}/donorfile