From: Dave Chinner Date: Thu, 7 Sep 2006 04:01:04 +0000 (+0000) Subject: Fix test 004 for recent TOT kernels. X-Git-Tag: v1.1.0~583 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=fcc1b181e08acb7b5598a6890db9b9d5ce93912a;p=xfstests-dev.git Fix test 004 for recent TOT kernels. Merge of master-melb:xfs-cmds:26932a by kenmcd. Take into account out put from df does not include space required for AG freelists on 2.6.18+ kernels. --- diff --git a/004 b/004 index 56cbb77b..bba61751 100755 --- a/004 +++ b/004 @@ -68,13 +68,19 @@ echo "xfs_db for $SCRATCH_DEV" >>$seq.full cat $tmp.xfs_db >>$seq.full # check the 'blocks' field from freesp command is OK +# since 2.6.18, df does not report the 4 blocks per AG that cannot +# be allocated, hence we check for that exact mismatch. perl -ne ' BEGIN { $avail ='$avail' * 512; $answer="(no xfs_db free blocks line?)" } /free blocks (\d+)$/ || next; $freesp = $1 * '$dbsize'; if ($freesp == $avail) { $answer = "yes"; } - else { $answer = "no ($freesp != $avail)"; } + else { + $avail = $avail + (('$agcount' + 1) * '$dbsize' * 4); + if ($freesp == $avail) { $answer = "yes"; } + else { $answer = "no ($freesp != $avail)"; } + } END { print "$answer\n" } ' <$tmp.xfs_db >$tmp.ans ans="`cat $tmp.ans`"