This change makes test 041 function correctly other blocks sizes, not just 4096.

The FS bsize is extracted from _filter_mkfs and then used to calculate growfs "destination" size.
Merge of master-melb:xfs-cmds:28222a by kenmcd.

  calculate one meg in blocks, then use that value to calculate grow-to values.
This commit is contained in:
David Disseldorp
2007-03-09 02:58:48 +00:00
parent 0e907ec7cf
commit a34fe069a5
2 changed files with 12 additions and 10 deletions
+8 -6
View File
@@ -51,19 +51,21 @@ rm -f $seq.full
agsize=32
echo -n "Make $agsize megabyte filesystem on SCRATCH_DEV and mount... "
_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 >/dev/null || _fail "mkfs failed"
bsize=`_scratch_mkfs_xfs -dsize=${agsize}m,agcount=1 2>&1 | _filter_mkfs 2>&1 \
| perl -ne 'if (/dbsize=(\d+)/) {print $1;}'`
onemeginblocks=`expr 1048576 / $bsize`
_scratch_mount || _fail "mount failed"
echo "done"
# full allocation group -> partial; partial -> expand partial + new partial;
# partial -> expand partial; partial -> full
# 17 -> 33 -> 35 -> 48 megabytes, converted to fs blocks below
# for size in 4352 8448 8960 12288
# 33 -> 67 -> 75 -> 96 converted to fs blocks:
for size in 8448 17512 19200 24576
# cycle through 33m -> 67m -> 75m -> 96m
for size in 33 67 75 96
do
grow_size=`expr $size \* $onemeginblocks`
_fill $SCRATCH_MNT/fill_$size
_do "Grow filesystem to $size blocks" "xfs_growfs -D ${size} $SCRATCH_MNT"
_do "Grow filesystem to ${size}m" "xfs_growfs -D $grow_size $SCRATCH_MNT"
echo -n "Flush filesystem... "
_do "umount $SCRATCH_MNT"
_do "_scratch_mount"
@@ -73,7 +75,7 @@ do
echo "fail (see $seq.full)"
_do "cat $tmp.manifest"
_do "ls -altrR $SCRATCH_MNT"
_do "dd if=$SCRATCH_DEV bs=4096 count=$size | gzip -9 > $seq.fsimage.gz"
_do "dd if=$SCRATCH_DEV bs=4096 count=$grow_size | gzip -9 > $seq.fsimage.gz"
status=1 ; exit
fi
echo "done"
+4 -4
View File
@@ -1,19 +1,19 @@
QA output created by 041
Make 32 megabyte filesystem on SCRATCH_DEV and mount... done
Fill filesystem... done
Grow filesystem to 8448 blocks... done
Grow filesystem to 33m... done
Flush filesystem... done
Check files... done
Fill filesystem... done
Grow filesystem to 17512 blocks... done
Grow filesystem to 67m... done
Flush filesystem... done
Check files... done
Fill filesystem... done
Grow filesystem to 19200 blocks... done
Grow filesystem to 75m... done
Flush filesystem... done
Check files... done
Fill filesystem... done
Grow filesystem to 24576 blocks... done
Grow filesystem to 96m... done
Flush filesystem... done
Check files... done
Growfs tests passed.