From patchwork Fri Jan 13 17:05:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9516007 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1A56F60762 for ; Fri, 13 Jan 2017 17:05:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0941428699 for ; Fri, 13 Jan 2017 17:05:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0DD028767; Fri, 13 Jan 2017 17:05:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1475D28699 for ; Fri, 13 Jan 2017 17:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751028AbdAMRFq (ORCPT ); Fri, 13 Jan 2017 12:05:46 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:45244 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751013AbdAMRFp (ORCPT ); Fri, 13 Jan 2017 12:05:45 -0500 Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1cS5IN-0004fs-W2; Fri, 13 Jan 2017 17:05:44 +0000 From: Christoph Hellwig To: fstests@vger.kernel.org Cc: linux-xfs@vger.kernel.org Subject: [PATCH] xfs/004: account for XFS reservations changes in 4.10-rc Date: Fri, 13 Jan 2017 18:05:40 +0100 Message-Id: <1484327140-13654-1-git-send-email-hch@lst.de> X-Mailer: git-send-email 2.1.4 X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP And drop support for some really old kernels to clean things up. Signed-off-by: Christoph Hellwig --- 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