xfs/004: account for XFS reservations changes in 4.10-rc

And drop support for some really old kernels to clean things up.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Christoph Hellwig
2017-01-13 18:05:40 +01:00
committed by Eryu Guan
parent 600b4b2bba
commit 8c3d7ebd23
+6 -17
View File
@@ -83,29 +83,18 @@ eval `$XFS_IO_PROG -x -c resblks $SCRATCH_MNT 2>&1 \
echo "resblks gave: resblks=$resblks" >>$seqres.full echo "resblks gave: resblks=$resblks" >>$seqres.full
# check the 'blocks' field from freesp command is OK # check the 'blocks' field from freesp command is OK
# since 2.6.18, df does not report the 4 blocks per AG that cannot # - starting with Linux 4.10-rc the bmbt split reservation moved to be per-AG
# be allocated, hence we check for that exact mismatch.
# since ~2.6.22, reserved blocks are used by default and df does
# not report them, hence check for an exact mismatch.
perl -ne ' perl -ne '
BEGIN { $avail ='$avail' * 512; BEGIN { $avail ='$avail' * 512 + ('$resblks' * '$dbsize');
$answer="(no xfs_db free blocks line?)" } $answer="(no xfs_db free blocks line?)" }
/free blocks (\d+)$/ || next; /free blocks (\d+)$/ || next;
$freesp = $1 * '$dbsize'; $freesp = $1 * '$dbsize';
if ($freesp == $avail) { if ($freesp == $avail + ('$agcount') * '$dbsize' * 8) {
$answer = "yes";
} elsif ($freesp == $avail + (('$agcount' + 1) * '$dbsize' * 4)) {
$answer = "yes"; $answer = "yes";
} else { } else {
$avail = $avail + (('$agcount' + 1) * '$dbsize' * 4); $answer = "no ($freesp != $avail)";
if ($freesp == $avail) {
$answer = "yes";
} else {
$avail = $avail + ('$resblks' * '$dbsize');
if ($freesp == $avail) {
$answer = "yes";
} else {
$answer = "no ($freesp != $avail)";
}
}
} }
END { print "$answer\n" } END { print "$answer\n" }
' <$tmp.xfs_db >$tmp.ans ' <$tmp.xfs_db >$tmp.ans