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: 9213651 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 7521B60572 for ; Tue, 5 Jul 2016 05:40:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65F212886B for ; Tue, 5 Jul 2016 05:40:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 57D0B28869; Tue, 5 Jul 2016 05:40:26 +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 F069F28869 for ; Tue, 5 Jul 2016 05:40:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751219AbcGEFj6 (ORCPT ); Tue, 5 Jul 2016 01:39:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56487 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750860AbcGEFjg (ORCPT ); Tue, 5 Jul 2016 01:39:36 -0400 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 Cc: xfs@oss.sgi.com, Eryu Guan Subject: [PATCH] common/rc: avoid mkfs option conflicts in _scratch_mkfs_xfs_supported Date: Tue, 5 Jul 2016 13:39:13 +0800 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) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org 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()