]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfstests: _fail in _scratch_mkfs_sized if device is too small
authorEric Sandeen <sandeen@redhat.com>
Thu, 29 Nov 2012 18:47:22 +0000 (12:47 -0600)
committerBen Myers <bpm@sgi.com>
Tue, 18 Dec 2012 18:05:49 +0000 (12:05 -0600)
Without this, 273 was failing in cryptic ways for me
if the device size was < 2G.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
common.rc

index bf9c86f87d872c9d578cb9ef991fbed375198a40..7be078b35a52c69134926c78e200baf02b3bd716 100644 (file)
--- 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