From patchwork Tue Oct 25 13:38:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9394541 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 8635F60231 for ; Tue, 25 Oct 2016 13:39:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 794D7294F5 for ; Tue, 25 Oct 2016 13:39:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DFA229514; Tue, 25 Oct 2016 13:39:17 +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 0007F294F5 for ; Tue, 25 Oct 2016 13:39:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941652AbcJYNjQ (ORCPT ); Tue, 25 Oct 2016 09:39:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33288 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932522AbcJYNjP (ORCPT ); Tue, 25 Oct 2016 09:39:15 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9AF84C04B95C; Tue, 25 Oct 2016 13:39:14 +0000 (UTC) Received: from localhost (dhcp12-157.nay.redhat.com [10.66.12.157] (may be forged)) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9PDdD6W013797; Tue, 25 Oct 2016 09:39:14 -0400 From: Eryu Guan To: fstests@vger.kernel.org Cc: linux-xfs@vger.kernel.org, Eryu Guan Subject: [PATCH v2] xfs/054: only filter ROOT_INO at the beginning Date: Tue, 25 Oct 2016 21:38:49 +0800 Message-Id: <1477402729-13934-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 25 Oct 2016 13:39:14 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In the test ROOT_INO is filtered out and/or replaced, but if ROOT_INO is also 32, more "32"s are filtered and replaced than expected. This happens to me when testing 512B block size XFS and 1k block size CRC enabled XFS. Fix it by filtering out only ROOT_INO at the beginning of a line, and removing all "g" modifiers in sed expressions. Also the ROOT_INO should be the root inode number of TEST_DIR not SCRATCH_MNT. Signed-off-by: Eryu Guan Reviewed-by: Dave Chinner --- v2: - remove all "g" modifiers in sed expressions tests/xfs/054 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/xfs/054 b/tests/xfs/054 index 7d08f8a..57b49e7 100755 --- a/tests/xfs/054 +++ b/tests/xfs/054 @@ -52,13 +52,13 @@ _require_test _require_xfs_io_command "inode" # We know the root inode is there -ROOT_INO=`ls -id $SCRATCH_MNT | awk '{print $1}'` +ROOT_INO=`ls -id $TEST_DIR | awk '{print $1}'` touch $TEST_DIR/file $XFS_IO_PROG -c "inode" $TEST_DIR/file $XFS_IO_PROG -c "inode -v" $TEST_DIR/file | \ - grep -vw $ROOT_INO | sed -e s/.*:/LAST:/g + grep -vw "^$ROOT_INO" | sed -e s/.*:/LAST:/ # These should fail, -n requires an inode $XFS_IO_PROG -c "inode -n" $TEST_DIR/file 2>&1 | grep -q Query \ @@ -83,15 +83,15 @@ $XFS_IO_PROG -c "inode -n -v badnumber" $TEST_DIR/file | grep -q numeric \ # These should all work, and return $ROOT_INO or the next inode... # grep out ROOT_INO (which is incorrect) when we should be getting next inode $XFS_IO_PROG -c "inode $ROOT_INO" $TEST_DIR/file | \ - sed -e s/$ROOT_INO/ROOT_INO/g + sed -e s/$ROOT_INO/ROOT_INO/ $XFS_IO_PROG -c "inode -v $ROOT_INO" $TEST_DIR/file | \ - sed -e s/$ROOT_INO/ROOT_INO/g + sed -e s/$ROOT_INO/ROOT_INO/ $XFS_IO_PROG -c "inode -n $ROOT_INO" $TEST_DIR/file | \ - grep -vw $ROOT_INO | sed -e s/.*/NEXT/g + grep -vw "^$ROOT_INO" | sed -e s/.*/NEXT/ $XFS_IO_PROG -c "inode -nv $ROOT_INO" $TEST_DIR/file | \ - grep -vw $ROOT_INO | sed -e s/.*:/NEXT:/g + grep -vw "^$ROOT_INO" | sed -e s/.*:/NEXT:/ $XFS_IO_PROG -c "inode -n -v $ROOT_INO" $TEST_DIR/file | \ - grep -vw $ROOT_INO | sed -e s/.*:/NEXT:/g + grep -vw "^$ROOT_INO" | sed -e s/.*:/NEXT:/ # Try one that doesn't exist, 2^64-2? Should get 0 $XFS_IO_PROG -c "inode 18446744073709551614" $TEST_DIR/file