be smarter about figuring out blocksize.
authorfsgqa <fsgqa>
Thu, 9 May 2002 23:34:47 +0000 (23:34 +0000)
committerfsgqa <fsgqa>
Thu, 9 May 2002 23:34:47 +0000 (23:34 +0000)
004
004.out

diff --git a/004 b/004
index fb8299f053e11007be64a8a6f550af27989a03fc..ae11d9c1ae78e3f6cf9f9e13e6815cbd3f6bf12b 100755 (executable)
--- a/004
+++ b/004
@@ -56,7 +56,8 @@ trap "_cleanup" 0 1 2 3 15
 
 _populate_scratch()
 {
-       mkfs_xfs $SCRATCH_DEV >/dev/null 2>&1
+       mkfs_xfs $SCRATCH_DEV | _filter_mkfs 2>$tmp.mkfs
+       source $tmp.mkfs
        mount -t xfs $SCRATCH_DEV $SCRATCH_MNT
        dd if=/dev/zero of=$SCRATCH_MNT/foo count=200 bs=4096 >/dev/null 2>&1 &
        dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
@@ -82,16 +83,7 @@ _populate_scratch
 eval `df -P -T --block-size=512 $SCRATCH_MNT 2>&1 \
        | $AWK_PROG 'END { printf "blocks=%u used=%u avail=%u\n", $3, $4, $5 }'`
 echo "df gave: blocks=$blocks used=$used avail=$avail" >>$seq.full
-
-blksize=`xfs_db -r -c sb -c p $SCRATCH_DEV |grep blocksize |sed -e 's/.*= *//'`
-if [ -z "$blksize" ]
-then
-       echo "Arrgh ... cannot determine blocksize for $fs, xfs_db reports"
-       xfs_db -r -c sb -c p $SCRATCH_DEV
-       status=1
-       continue
-fi
-echo "blocksize from xfs_db is '$blksize'" >>$seq.full
+echo "blocksize from mkfs is '$dbsize'" >>$seq.full
 
 xfs_db -r -c "freesp -s" $SCRATCH_DEV >$tmp.xfs_db
 echo "xfs_db for $SCRATCH_DEV" >>$seq.full
@@ -102,7 +94,7 @@ perl -ne '
            BEGIN       { $avail ='$avail' * 512;
                          $answer="(no xfs_db free blocks line?)" }
            /free blocks (\d+)$/        || next;
-           $freesp = $1 * '$blksize';
+           $freesp = $1 * '$dbsize';
            if ($freesp == $avail)      { $answer = "yes"; }
            else                        { $answer = "no ($freesp != $avail)"; }
            END { print "$answer\n" }
diff --git a/004.out b/004.out
index b598b9035165acc6dcc9d2d101c204a58221eadb..b94d653d9e242d11324759ea62b3b15933dc77cd 100644 (file)
--- a/004.out
+++ b/004.out
@@ -1,3 +1,9 @@
 QA output created by 004
+meta-data=DDEV isize=XXX agcount=N, agsize=XXX blks
+data     = bsize=XXX blocks=XXX, imaxpct=PCT
+         = sunit=XXX swidth=XXX, unwritten=X
+naming   =VERN bsize=XXX
+log      =LDEV bsize=XXX blocks=XXX
+realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX
 Checking blocks column same as df: yes
 Checking percent column yields 100: 100