From: Eryu Guan Date: Wed, 4 Jul 2012 03:11:10 +0000 (-0500) Subject: common.attr: get block size of test fs not root fs X-Git-Tag: v2022.05.01~3600^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=187e92903f3b8d59658b8ed7d1aa847ae6365f3c;p=xfstests-dev.git common.attr: get block size of test fs not root fs stat -f $TEST_DEV shows block size of the fs where $TEST_DEV resides, usually it is the root fs. This will fail 020 on non-4096 block size ext2/3/4, also 4096 block size ext2/3/4 on ppc64. Instead, stat -f $TEST_DIR will show block size of the fs to be tested. Tested and passed on ext2/3/4, xfs, btrfs with all supported block size. Cc: Eric Sandeen Signed-off-by: Eryu Guan Signed-off-by: Eric Sandeen --- diff --git a/common.attr b/common.attr index 0f1e7891..6e2c004b 100644 --- a/common.attr +++ b/common.attr @@ -187,7 +187,7 @@ _sort_getfattr_output() if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" ]; then MAX_ATTRS=1000 else # Assume max ~1 block of attrs - BLOCK_SIZE=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3` + BLOCK_SIZE=`stat -f $TEST_DIR | grep "Block size" | cut -d " " -f3` # user.attribute_XXX="value.XXX" is about 32 bytes; leave some overhead let MAX_ATTRS=$BLOCK_SIZE/40 fi @@ -198,7 +198,7 @@ export MAX_ATTRS if [ "$FSTYP" == "xfs" -o "$FSTYP" == "udf" -o "$FSTYP" == "btrfs" ]; then MAX_ATTRVAL_SIZE=64 else # Assume max ~1 block of attrs - BLOCK_SIZE=`stat -f $TEST_DEV | grep "Block size" | cut -d " " -f3` + BLOCK_SIZE=`stat -f $TEST_DIR | grep "Block size" | cut -d " " -f3` # leave a little overhead let MAX_ATTRVAL_SIZE=$BLOCK_SIZE-256 fi