From patchwork Wed May 17 01:42:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 9729899 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 11FB160387 for ; Wed, 17 May 2017 01:42:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0527A286BA for ; Wed, 17 May 2017 01:42:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE18128711; Wed, 17 May 2017 01:42:48 +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 9A868286BA for ; Wed, 17 May 2017 01:42:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750930AbdEQBms (ORCPT ); Tue, 16 May 2017 21:42:48 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:45290 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750759AbdEQBmr (ORCPT ); Tue, 16 May 2017 21:42:47 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="18941499" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 17 May 2017 09:42:45 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id 595FF47C654A; Wed, 17 May 2017 09:42:41 +0800 (CST) Received: from localhost.localdomain (10.167.220.81) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 17 May 2017 09:42:41 +0800 From: Xiao Yang To: CC: , , Xiao Yang Subject: [PATCH v2 2/2] common: cleanup _require_xfs_io_command Date: Wed, 17 May 2017 09:42:33 +0800 Message-ID: <1494985353-13746-2-git-send-email-yangx.jy@cn.fujitsu.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1494985353-13746-1-git-send-email-yangx.jy@cn.fujitsu.com> References: <20170516080455.GX7250@eguan.usersys.redhat.com> <1494985353-13746-1-git-send-email-yangx.jy@cn.fujitsu.com> MIME-Version: 1.0 X-Originating-IP: [10.167.220.81] X-yoursite-MailScanner-ID: 595FF47C654A.AA5F1 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: yangx.jy@cn.fujitsu.com Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need to check specific flags at the end of this function if we have checked them before. e.g, generic/071 and generic/422 are marked as notrun unexpectedly because xfs_io doesn't support long-format help for falloc before xfsprogs v4.9. Actually, xfs_io has supported falloc, so these case should not be marked as notrun. Signed-off-by: Xiao Yang --- common/rc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/rc b/common/rc index 539f153..6c27dea 100644 --- a/common/rc +++ b/common/rc @@ -2041,6 +2041,7 @@ _require_xfs_io_command() command=$1 shift param="$*" + param_check=0 testfile=$TEST_DIR/$$.xfs_io case $command in @@ -2055,6 +2056,7 @@ _require_xfs_io_command() ;; "falloc" ) testio=`$XFS_IO_PROG -F -f -c "falloc $param 0 1m" $testfile 2>&1` + param_check=1 ;; "fpunch" | "fcollapse" | "zero" | "fzero" | "finsert" | "funshare") testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \ @@ -2063,6 +2065,7 @@ _require_xfs_io_command() "fiemap") testio=`$XFS_IO_PROG -F -f -c "pwrite 0 20k" -c "fsync" \ -c "fiemap -v $param" $testfile 2>&1` + param_check=1 ;; "flink" ) testio=`$XFS_IO_PROG -T -F -c "flink $testfile" \ @@ -2087,7 +2090,7 @@ _require_xfs_io_command() testio=`$XFS_IO_PROG -f -c "utimes" 0 0 0 0 $testfile 2>&1` ;; *) - testio=`$XFS_IO_PROG -c "$command help" 2>&1` + testio=`$XFS_IO_PROG -c "help $command" 2>&1` esac rm -f $testfile 2>&1 > /dev/null @@ -2100,9 +2103,10 @@ _require_xfs_io_command() echo $testio | grep -q "foreign file active" && \ _notrun "xfs_io $command not supported on $FSTYP" - test -z "$param" && return - $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ - _notrun "xfs_io $command doesn't support $param" + if [ -n "$param" -a $param_check -eq 0 ]; then + $XFS_IO_PROG -c "help $command" | grep -q "^ $param --" || \ + _notrun "xfs_io $command doesn't support $param" + fi } # check that kernel and filesystem support direct I/O