* [PATCH] xfs/004: account for XFS reservations changes in 4.10-rc
@ 2017-01-13 17:05 Christoph Hellwig
0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2017-01-13 17:05 UTC (permalink / raw)
To: fstests; +Cc: linux-xfs
And drop support for some really old kernels to clean things up.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
tests/xfs/004 | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/tests/xfs/004 b/tests/xfs/004
index 09da2fe..bbc1aee 100755
--- a/tests/xfs/004
+++ b/tests/xfs/004
@@ -83,29 +83,18 @@ eval `$XFS_IO_PROG -x -c resblks $SCRATCH_MNT 2>&1 \
echo "resblks gave: resblks=$resblks" >>$seqres.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.
-# since ~2.6.22, reserved blocks are used by default and df does
-# not report them, hence check for an exact mismatch.
+# - starting with Linux 4.10-rc the bmbt split reservation moved to be per-AG
perl -ne '
- BEGIN { $avail ='$avail' * 512;
+ BEGIN { $avail ='$avail' * 512 + ('$resblks' * '$dbsize');
$answer="(no xfs_db free blocks line?)" }
/free blocks (\d+)$/ || next;
$freesp = $1 * '$dbsize';
- if ($freesp == $avail) {
+ if ($freesp == $avail + ('$agcount') * '$dbsize' * 8) {
+ $answer = "yes";
+ } elsif ($freesp == $avail + (('$agcount' + 1) * '$dbsize' * 4)) {
$answer = "yes";
} else {
- $avail = $avail + (('$agcount' + 1) * '$dbsize' * 4);
- if ($freesp == $avail) {
- $answer = "yes";
- } else {
- $avail = $avail + ('$resblks' * '$dbsize');
- if ($freesp == $avail) {
- $answer = "yes";
- } else {
- $answer = "no ($freesp != $avail)";
- }
- }
+ $answer = "no ($freesp != $avail)";
}
END { print "$answer\n" }
' <$tmp.xfs_db >$tmp.ans
--
2.1.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2017-01-13 17:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-13 17:05 [PATCH] xfs/004: account for XFS reservations changes in 4.10-rc Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).