From patchwork Tue Jul 5 05:39:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 9213647 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 4B85F60572 for ; Tue, 5 Jul 2016 05:39:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E863288B5 for ; Tue, 5 Jul 2016 05:39:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3362B288B8; Tue, 5 Jul 2016 05:39:41 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from oss.sgi.com (oss.sgi.com [192.48.182.195]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A42C7288B5 for ; Tue, 5 Jul 2016 05:39:40 +0000 (UTC) Received: from oss.sgi.com (localhost [IPv6:::1]) by oss.sgi.com (Postfix) with ESMTP id B40A67CB8; Tue, 5 Jul 2016 00:39:38 -0500 (CDT) X-Original-To: xfs@oss.sgi.com Delivered-To: xfs@oss.sgi.com Received: from relay.sgi.com (relay2.corp.sgi.com [137.38.102.29]) by oss.sgi.com (Postfix) with ESMTP id D540A7CB7 for ; Tue, 5 Jul 2016 00:39:36 -0500 (CDT) Received: from cuda.sgi.com (cuda2.sgi.com [192.48.176.25]) by relay2.corp.sgi.com (Postfix) with ESMTP id A34D5304032 for ; Mon, 4 Jul 2016 22:39:36 -0700 (PDT) X-ASG-Debug-ID: 1467697175-04cbb02735534050001-NocioJ Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by cuda.sgi.com with ESMTP id nYzcN1xzrZVs8tHp (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Mon, 04 Jul 2016 22:39:35 -0700 (PDT) X-Barracuda-Envelope-From: eguan@redhat.com X-Barracuda-Effective-Source-IP: mx1.redhat.com[209.132.183.28] X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-ASG-Whitelist: Client Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (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 25921C05B1CD; Tue, 5 Jul 2016 05:39:35 +0000 (UTC) Received: from localhost (dhcp-13-191.nay.redhat.com [10.66.13.191]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u655dXc3025115; Tue, 5 Jul 2016 01:39:34 -0400 From: Eryu Guan To: fstests@vger.kernel.org Subject: [PATCH] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported Date: Tue, 5 Jul 2016 13:39:13 +0800 X-ASG-Orig-Subj: [PATCH] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported Message-Id: <1467697153-23189-1-git-send-email-eguan@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 05 Jul 2016 05:39:35 +0000 (UTC) X-Barracuda-Connect: mx1.redhat.com[209.132.183.28] X-Barracuda-Start-Time: 1467697175 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://192.48.176.25:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1425 X-Virus-Scanned: by bsmtpd at sgi.com X-Barracuda-BRTS-Status: 1 Cc: Eryu Guan , xfs@oss.sgi.com X-BeenThere: xfs@oss.sgi.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com X-Virus-Scanned: ClamAV using ClamSMTP In recent mkfs.xfs updates in xfsprogs, commit 9090e187bc3e ("mkfs: add respecification detection to generic parsing") added re-specification detection to "-m" option, it causes several tests _notrun if MKFS_OPTIONS has the same options as those being tested in _scratch_mkfs_xfs_supported(), because they're specified multiple times. MKFS_OPTIONS="-m crc=0" ./check xfs/001 xfs/001 3s ... [not run] mkfs.xfs doesn't have crc feature Fix it by creating XFS again without MKFS_OPTIONS in _scratch_mkfs_xfs_supported(), in case there's conflict between MKFS_OPTIONS and mkfs_opts, like what we do in _scratch_mkfs_xfs(). Signed-off-by: Eryu Guan --- common/rc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 883bd7b..ad81461 100644 --- a/common/rc +++ b/common/rc @@ -473,11 +473,20 @@ _scratch_mkfs_xfs_opts() _scratch_mkfs_xfs_supported() { - mkfs_opts=$* + local mkfs_opts=$* _scratch_options mkfs $MKFS_XFS_PROG -N $MKFS_OPTIONS $SCRATCH_OPTIONS $mkfs_opts $SCRATCH_DEV + local mkfs_status=$? + + # if $mkfs_opts conflits with $MKFS_OPTIONS, + # try again without $MKFS_OPTIONS + if [ $mkfs_status -ne 0 -a -n "$MKFS_OPTIONS" ]; then + $MKFS_XFS_PROG -N $SCRATCH_OPTIONS $mkfs_opts $SCRATCH_DEV + mkfs_status=$? + fi + return $mkfs_status } _scratch_mkfs_xfs()