xfsqa: define resblks for tests near ENOSPC
PATCH 1/1 xfsqa: define resblks for tests near ENOSPC
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.
--- 104 | 4 ++++ 204 | 4 ++++ 205 | 4 ++++ 3 files changed, 12 insertions(+), 0 deletions(-)
104 +4 -0
@@ -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. + xfs_io -x -c "resblks 1024" $SCRATCH_MNT > /dev/null 2>&1 } _fill_scratch()
204 +4 -0
@@ -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. +xfs_io -x -c "resblks 1024" $SCRATCH_MNT >> $seq.full 2>&1 + for i in `seq 1 22500`; do echo -n > $SCRATCH_MNT/$i echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX > $SCRATCH_MNT/$i
205 +4 -0
@@ -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. +xfs_io -x -c "resblks 1024" $SCRATCH_MNT >> $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
Signature · 6 lines
1.6.5 _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
104 _create_scratch() · line 54
Quoted 3 lines · Dave Chinner
104 +3
-0+ # fix the reserve block pool to a known size so that the enospc + # calculations work out correctly. + xfs_io -x -c "resblks 1024" $SCRATCH_MNT > /dev/null 2>&1
What about a _scratch_resvblks helper - that means we could also add noops for non-xfs filesystems there easily.
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 7 lines · Christoph Hellwig
104 _create_scratch() · line 54
Quoted 3 lines · Dave Chinner
104 +3
-0+ # fix the reserve block pool to a known size so that the enospc + # calculations work out correctly. + xfs_io -x -c "resblks 1024" $SCRATCH_MNT > /dev/null 2>&1What about a
_scratch_resvblkshelper - that means we could also add noops for non-xfs filesystems there easily.
Good idea. I'll rework the patch to do this.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
PATCH v2 1/1 xfsqa: define resblks for tests near ENOSPC
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.
--- 104 | 4 ++++ 204 | 4 ++++ 205 | 4 ++++ common.rc | 11 +++++++++++ 4 files changed, 23 insertions(+), 0 deletions(-)
104 +4 -0
@@ -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()
204 +4 -0
@@ -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
205 +4 -0
@@ -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
common.rc +11 -0
@@ -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=""
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 9 lines · Dave Chinner
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.
Looks good,
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs