]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfsqa: define resblks for tests near ENOSPC
authorDave Chinner <david@fromorbit.com>
Sat, 6 Mar 2010 00:25:10 +0000 (11:25 +1100)
committerDave Chinner <david@fromorbit.com>
Sat, 6 Mar 2010 00:25:10 +0000 (11:25 +1100)
Several tests assume a certain amount of disk space free after the
reserve block pool is filled. Changing the default size of the
reserve block pool breaks these tests because there is less space
available that first thought.

Change these tests to specify a known reserve block pool size of
1024 blocks to ensure that they continue to work correctly even if
the default size changes.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
104
204
205
common.rc

diff --git a/104 b/104
index b35c43bc3a9e1115d3b0fcfe33e598d406892d53..14f2669c1d37db099555a7ff7d3fb1cac3ffc14c 100755 (executable)
--- a/104
+++ b/104
@@ -48,6 +48,10 @@ _create_scratch()
                echo "failed to mount $SCRATCH_DEV"
                exit 1
        fi
+
+       # fix the reserve block pool to a known size so that the enospc
+       # calculations work out correctly.
+       _scratch_resvblks 1024 >  /dev/null 2>&1
 }
 
 _fill_scratch()
diff --git a/204 b/204
index 8b94f608f153ae9db9e9c80951b2bab0a61786d9..9f4839c7767feadc2197e8cc89d3c484bd5f13f4 100755 (executable)
--- a/204
+++ b/204
@@ -44,6 +44,10 @@ SIZE=`expr 104 \* 1024 \* 1024`
 _scratch_mkfs_sized $SIZE  &> /dev/null
 _scratch_mount
 
+# fix the reserve block pool to a known size so that the enospc calculations
+# work out correctly.
+_scratch_resvblks 1024 > $seq.full 2>&1
+
 for i in `seq 1 22500`; do
     echo -n > $SCRATCH_MNT/$i
     echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
diff --git a/205 b/205
index 3f45185cbf6408fdd066f4e6a69467e91496b270..35d69929009283bf12b675c007d220cd9e41da44 100755 (executable)
--- a/205
+++ b/205
@@ -43,6 +43,10 @@ _require_scratch
 _scratch_mkfs_xfs -d size=16m -b size=512 >/dev/null
 _scratch_mount
 
+# fix the reserve block pool to a known size so that the enospc calculations
+# work out correctly.
+_scratch_resvblks 1024 > $seq.full 2>&1
+
 # on a 16MB filesystem, there's 32768x512byte blocks. used is:
 #      - 4944 in the log,
 #      - 32+1 for the root inode cluster
index d71e0a2d968876fc238d9cb578e1bca0a63b6bf8..2103a7751d0b8a042687fc30aeb37d85f30497f8 100644 (file)
--- a/common.rc
+++ b/common.rc
@@ -361,6 +361,17 @@ _scratch_mkfs_geom()
     _scratch_mkfs
 }
 
+_scratch_resvblks()
+{
+       case $FSTYP in
+       xfs)
+               xfs_io -x -c "resblks $1" $SCRATCH_MNT
+               ;;
+       *)
+               ;;
+       esac
+}
+
 _scratch_xfs_db_options()
 {
     SCRATCH_OPTIONS=""