From: Darrick J. Wong Date: Wed, 11 Nov 2020 00:43:39 +0000 (-0800) Subject: misc: fix _get_file_block_size usage X-Git-Tag: v2022.05.01~596 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=0d444a9a29e385ead98f8aaf82701bc3d94b2759 misc: fix _get_file_block_size usage Fix these tests that rely on the allocation unit size of a file, which might not necessarily be the fs block size. Signed-off-by: Darrick J. Wong Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/tests/generic/157 b/tests/generic/157 index 5ec8999e..379c38b9 100755 --- a/tests/generic/157 +++ b/tests/generic/157 @@ -46,7 +46,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/generic/175 b/tests/generic/175 index f1b73522..436d2cca 100755 --- a/tests/generic/175 +++ b/tests/generic/175 @@ -41,7 +41,7 @@ testdir="$SCRATCH_MNT/test-$seq" mkdir "$testdir" echo "Create a one block file" -blksz="$(_get_block_size $testdir)" +blksz="$(_get_file_block_size $testdir)" _pwrite_byte 0x61 0 $blksz "$testdir/file1" >> "$seqres.full" fnr=19 diff --git a/tests/xfs/129 b/tests/xfs/129 index 5e348805..78baf5c4 100755 --- a/tests/xfs/129 +++ b/tests/xfs/129 @@ -44,7 +44,7 @@ mkdir $testdir metadump_file=$TEST_DIR/${seq}_metadump echo "Create the original file blocks" -blksz="$(_get_block_size $testdir)" +blksz="$(_get_file_block_size $testdir)" nr_blks=$((4 * blksz / 12)) _pwrite_byte 0x61 0 $((blksz * nr_blks)) $testdir/file1 >> $seqres.full diff --git a/tests/xfs/169 b/tests/xfs/169 index 44577fbf..2051091f 100755 --- a/tests/xfs/169 +++ b/tests/xfs/169 @@ -42,7 +42,7 @@ testdir=$SCRATCH_MNT/test-$seq mkdir $testdir echo "Create the original file blocks" -blksz="$(_get_block_size $testdir)" +blksz="$(_get_file_block_size $testdir)" nr_blks=$((8 * blksz / 12)) for i in 1 2 x; do diff --git a/tests/xfs/208 b/tests/xfs/208 index 104763d5..2a899fc0 100755 --- a/tests/xfs/208 +++ b/tests/xfs/208 @@ -56,7 +56,7 @@ bufnr=16 bufsize=$((blksz * bufnr)) _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) -real_blksz=$(_get_block_size $testdir) +real_blksz=$(_get_file_block_size $testdir) internal_blks=$((filesize / real_blksz)) echo "Create the original files" diff --git a/tests/xfs/336 b/tests/xfs/336 index 5f32f060..a006938d 100755 --- a/tests/xfs/336 +++ b/tests/xfs/336 @@ -39,7 +39,7 @@ _scratch_mkfs | _filter_mkfs 2>$tmp.mkfs >/dev/null . $tmp.mkfs cat $tmp.mkfs > "$seqres.full" 2>&1 _scratch_mount -blksz="$(_get_block_size $SCRATCH_MNT)" +blksz="$(_get_file_block_size $SCRATCH_MNT)" metadump_file=$TEST_DIR/${seq}_metadump rm -rf $metadump_file diff --git a/tests/xfs/344 b/tests/xfs/344 index b00541f6..46868fa5 100755 --- a/tests/xfs/344 +++ b/tests/xfs/344 @@ -55,7 +55,7 @@ bufnr=16 bufsize=$((blksz * bufnr)) _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) -real_blksz=$(_get_block_size $testdir) +real_blksz=$(_get_file_block_size $testdir) internal_blks=$((filesize / real_blksz)) echo "Create the original files" diff --git a/tests/xfs/345 b/tests/xfs/345 index ceb1dce9..4204cc22 100755 --- a/tests/xfs/345 +++ b/tests/xfs/345 @@ -53,7 +53,7 @@ bufnr=16 bufsize=$((blksz * bufnr)) _require_fs_space $SCRATCH_MNT $((filesize / 1024 * 3 * 5 / 4)) -real_blksz=$(_get_block_size $testdir) +real_blksz=$(_get_file_block_size $testdir) internal_blks=$((filesize / real_blksz)) echo "Create the original files"