From a34fe069a57ace92af17ef590a7f5a7619aa20cc Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Fri, 9 Mar 2007 02:58:48 +0000 Subject: [PATCH] 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. --- 041 | 14 ++++++++------ 041.out | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/041 b/041 index 94036e0e..45ed19d6 100755 --- a/041 +++ b/041 @@ -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" diff --git a/041.out b/041.out index 5266aeb7..0e675804 100644 --- a/041.out +++ b/041.out @@ -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. -- 2.30.2