[PATCH 2/4] xfs/259: drop the 512-byte fsblock logic from this test

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Darrick J. Wong <djwong@xxxxxxxxxx>

V5 filesystems do not support 512-byte fsblocks, and mkfs.xfs has long
defaulted to V5 filesystems.  Drop the 512 from the test loops, which
means we can get rid of all the _fs_has_crcs logic.  As a further
cleanup, use the truncate -s command to create the sparse file instead
of dd since even RHEL7 supports the -s switch.

Signed-off-by: "Darrick J. Wong" <djwong@xxxxxxxxxx>
---
 tests/xfs/259     |   24 ++++++++----------------
 tests/xfs/259.out |    7 -------
 2 files changed, 8 insertions(+), 23 deletions(-)


diff --git a/tests/xfs/259 b/tests/xfs/259
index c2d26381a91c02..e367d35acc3956 100755
--- a/tests/xfs/259
+++ b/tests/xfs/259
@@ -30,28 +30,20 @@ testfile=$TEST_DIR/259.image
 # Test various sizes slightly less than 4 TB. Need to handle different
 # minimum block sizes for CRC enabled filesystems, but use a small log so we
 # don't write lots of zeros unnecessarily.
-sizes_to_check="4096 2048 1024 512"
-blocksizes="4096 2048 1024 512"
+sizes_to_check="4096 2048 1024"
+blocksizes="4096 2048 1024"
 four_TB=$(_math "2^42")
-# The initial value of _fs_has_crcs is not important, because we start testing
-# with 4096 block size, it only matters for 512 block size test
-_fs_has_crcs=0
+
 for del in $sizes_to_check; do
 	for bs in $blocksizes; do
-		echo "Trying to make (4TB - ${del}B) long xfs, block size $bs"
-		# skip tests with 512 block size if the fs created has crc
-		# enabled by default
-		if [ $_fs_has_crcs -eq 1 -a $bs -eq 512 ]; then
-			break;
-		fi
+		echo "Trying to make (4TB - ${del}B) long xfs, block size $bs" | \
+			tee -a $seqres.full
 		ddseek=$(_math "$four_TB - $del")
 		rm -f "$testfile"
-		dd if=/dev/zero "of=$testfile" bs=1 count=0 seek=$ddseek \
-			>/dev/null 2>&1 || echo "dd failed"
+		truncate -s $ddseek "$testfile"
 		loop_dev=$(_create_loop_device $testfile)
-		$MKFS_XFS_PROG -l size=32m -b size=$bs $loop_dev |  _filter_mkfs \
-			>/dev/null 2> $tmp.mkfs || echo "mkfs failed!"
-		. $tmp.mkfs
+		$MKFS_XFS_PROG -l size=32m -b size=$bs $loop_dev >> $seqres.full || \
+			echo "mkfs failed!"
 		sync
 		_destroy_loop_device $loop_dev
 		unset loop_dev
diff --git a/tests/xfs/259.out b/tests/xfs/259.out
index 9fc4920c2b33b3..50af1a9b326147 100644
--- a/tests/xfs/259.out
+++ b/tests/xfs/259.out
@@ -2,16 +2,9 @@ QA output created by 259
 Trying to make (4TB - 4096B) long xfs, block size 4096
 Trying to make (4TB - 4096B) long xfs, block size 2048
 Trying to make (4TB - 4096B) long xfs, block size 1024
-Trying to make (4TB - 4096B) long xfs, block size 512
 Trying to make (4TB - 2048B) long xfs, block size 4096
 Trying to make (4TB - 2048B) long xfs, block size 2048
 Trying to make (4TB - 2048B) long xfs, block size 1024
-Trying to make (4TB - 2048B) long xfs, block size 512
 Trying to make (4TB - 1024B) long xfs, block size 4096
 Trying to make (4TB - 1024B) long xfs, block size 2048
 Trying to make (4TB - 1024B) long xfs, block size 1024
-Trying to make (4TB - 1024B) long xfs, block size 512
-Trying to make (4TB - 512B) long xfs, block size 4096
-Trying to make (4TB - 512B) long xfs, block size 2048
-Trying to make (4TB - 512B) long xfs, block size 1024
-Trying to make (4TB - 512B) long xfs, block size 512





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux