From: Eric Sandeen Date: Thu, 29 Nov 2012 18:47:22 +0000 (-0600) Subject: xfstests: _fail in _scratch_mkfs_sized if device is too small X-Git-Tag: v2022.05.01~3557 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3c2702432128776805d6978bb0229903425f23f3;p=xfstests-dev.git xfstests: _fail in _scratch_mkfs_sized if device is too small Without this, 273 was failing in cryptic ways for me if the device size was < 2G. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Signed-off-by: Ben Myers --- diff --git a/common.rc b/common.rc index bf9c86f8..7be078b3 100644 --- a/common.rc +++ b/common.rc @@ -348,6 +348,11 @@ _scratch_mkfs_sized() [ -z "$blocksize" ] && blocksize=4096 blocks=`expr $fssize / $blocksize` + if [ "$HOSTOS" == "Linux" ]; then + devsize=`blockdev --getsize64 $SCRATCH_DEV` + [ "$fssize" -gt "$devsize" ] && _notrun "Scratch device too small" + fi + case $FSTYP in xfs) _scratch_mkfs_xfs -d size=$fssize -b size=$blocksize