]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs/012: Enable test to be executed on non-4k block size filesystems
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Mon, 26 Dec 2016 17:32:32 +0000 (23:02 +0530)
committerEryu Guan <eguan@redhat.com>
Wed, 28 Dec 2016 11:35:47 +0000 (19:35 +0800)
To get the test to work on non-4k block sized filesystems, this
commit obtains the block size of the Btrfs filesystem from
$TEST_DIR.

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>
tests/btrfs/012

index b39dec0c755468c316d26ade10b01c94d4a3b506..cbd3882e42746e05e18b34ae447d061f2d30afb2 100755 (executable)
@@ -63,8 +63,10 @@ _require_command "$E2FSCK_PROG" e2fsck
 
 rm -f $seqres.full
 
+BLOCK_SIZE=`get_block_size $TEST_DIR`
+
 # Create & populate an ext4 filesystem
-$MKFS_EXT4_PROG -F -b 4096 $SCRATCH_DEV > $seqres.full 2>&1 || \
+$MKFS_EXT4_PROG -F -b $BLOCK_SIZE $SCRATCH_DEV > $seqres.full 2>&1 || \
        _notrun "Could not create ext4 filesystem"
 # Manual mount so we don't use -t btrfs or selinux context
 mount -t ext4 $SCRATCH_DEV $SCRATCH_MNT