Skip to contentSkip to conversation

xfs/004: relax freespace check

PATCH In review Christoph Hellwig 2 participants 2 messages Feb 28, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs/004: relax freespace check

Just check for a greater equals relation so that we don't have to adjust the test for every new reservation scheme we add..

---
 tests/xfs/004 | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
tests/xfs/004 +2 -5
index bbc1aee3..f27f4b79 100755
@@ -83,18 +83,15 @@ 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
-#  - starting with Linux 4.10-rc the bmbt split reservation moved to be per-AG
 perl -ne '
 	BEGIN	{ $avail ='$avail' * 512 + ('$resblks' * '$dbsize');
 		  $answer="(no xfs_db free blocks line?)" }
 	/free blocks (\d+)$/	|| next;
 	$freesp = $1 * '$dbsize';
-	if ($freesp == $avail + ('$agcount') * '$dbsize' * 8) {
-		$answer = "yes";
-	} elsif ($freesp == $avail + (('$agcount' + 1) * '$dbsize' * 4)) {
+	if ($freesp >= $avail) {
 		$answer = "yes";
 	} else {
-		$answer = "no ($freesp != $avail)";
+		$answer = "no ($freesp < $avail)";
 	}
 	END	{ print "$answer\n" }
 	' <$tmp.xfs_db >$tmp.ans
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Christoph Hellwig

Just check for a greater equals relation so that we don't have to adjust the test for every new reservation scheme we add..

Looks good!

Tired-of-fixing-this-so-hooray: Darrick J. Wong <[email protected]>

--D

Quoted 36 lines
---
 tests/xfs/004 | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
tests/xfs/004 +2 -5
index bbc1aee3..f27f4b79 100755
@@ -83,18 +83,15 @@ 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
-#  - starting with Linux 4.10-rc the bmbt split reservation moved to be per-AG
 perl -ne '
 	BEGIN	{ $avail ='$avail' * 512 + ('$resblks' * '$dbsize');
 		  $answer="(no xfs_db free blocks line?)" }
 	/free blocks (\d+)$/	|| next;
 	$freesp = $1 * '$dbsize';
-	if ($freesp == $avail + ('$agcount') * '$dbsize' * 8) {
-		$answer = "yes";
-	} elsif ($freesp == $avail + (('$agcount' + 1) * '$dbsize' * 4)) {
+	if ($freesp >= $avail) {
 		$answer = "yes";
 	} else {
-		$answer = "no ($freesp != $avail)";
+		$answer = "no ($freesp < $avail)";
 	}
 	END	{ print "$answer\n" }
 	' <$tmp.xfs_db >$tmp.ans
Signature · 6 lines
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html