diff mbox

xfs/004: relax freespace check

Message ID 20170228005235.9839-1-hch@lst.de (mailing list archive)
State New, archived
Headers show

Commit Message

Christoph Hellwig Feb. 28, 2017, 12:52 a.m. UTC
Just check for a greater equals relation so that we don't have
to adjust the test for every new reservation scheme we add..

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 tests/xfs/004 | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Darrick J. Wong Feb. 28, 2017, 5:35 a.m. UTC | #1
On Mon, Feb 27, 2017 at 04:52:35PM -0800, Christoph Hellwig wrote:
> Just check for a greater equals relation so that we don't have
> to adjust the test for every new reservation scheme we add..
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Looks good!

Tired-of-fixing-this-so-hooray: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  tests/xfs/004 | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/xfs/004 b/tests/xfs/004
> index bbc1aee3..f27f4b79 100755
> --- a/tests/xfs/004
> +++ b/tests/xfs/004
> @@ -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
> -- 
> 2.11.0
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tests/xfs/004 b/tests/xfs/004
index bbc1aee3..f27f4b79 100755
--- a/tests/xfs/004
+++ b/tests/xfs/004
@@ -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