From patchwork Fri May 11 03:05:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eryu Guan X-Patchwork-Id: 10392993 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 9F87460353 for ; Fri, 11 May 2018 03:08:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7AEEA2853E for ; Fri, 11 May 2018 03:08:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6EF8028592; Fri, 11 May 2018 03:08:07 +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=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 1B8EC2853E for ; Fri, 11 May 2018 03:08:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750937AbeEKDIG (ORCPT ); Thu, 10 May 2018 23:08:06 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36074 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbeEKDIF (ORCPT ); Thu, 10 May 2018 23:08:05 -0400 Received: by mail-pf0-f194.google.com with SMTP id w129-v6so2019299pfd.3; Thu, 10 May 2018 20:08:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=FQ80b2Q71XXE1VRjCnllsftHEEXzYKU9xc5XBoLw7kg=; b=Q4m0b7bEXfz5AojwgsSnMgPt+TWMves5zbz49Ia/ORZ1inrfv/n4+81X8KaUPwN/pk hHIwDrGjoBZEufsl/jM6z2wtvaIRZyYsL+yCFWLJBfSKiH3A7TieiUmpgIdZvlpxoYk2 OAqaQffF2j9DcbDIP5KNDRPNB2Mxwcv6i6DdJbCDOHTDzwbYNB1jgkGfBD1h3UO9A4jY bkHOZfM2SRY8Q+1qtGJ90fTRcrv2ZjJ0MBtNDwju1PD4VIogyJJv06bYDYgow9Is8gBt HwMuCGdYEL7+wyjyD/7okazL4BlLEOMo8THsV0gG+W8AvlYEfeRiwzNU9mLDX32WmtrC VbVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=FQ80b2Q71XXE1VRjCnllsftHEEXzYKU9xc5XBoLw7kg=; b=IiU0aMW7joT6OhSozQmTRsS2tN10ybN4m169ZIy5R2AYpBXLG8P1bbjy+wWTbZE4vF gLLpBNK9w3/SYmSrhDLenuE+pXqkB0Uiu2d1OD4+n1piltfuFIPXDIdeuEDcztWp9K9W XHRFxnRvVMUiKXNHrr7VOvfJ2FVcI17pOr2u2Kss6xKLr/qzht0UnWlMt2wEY/D/7p8V 6xhqG5y0p56zMpiTS/XojHGSDAXKVXsr8bl5j6ZJzCh6q10S2F47XaDbowf0xaXgwLnp RHj++9WfdHuDC12/MUzKufbyfcA/TP0nMDBImzCU4TfW4EbhyW+Mn7ylXNG1O3ERTKBs xFVA== X-Gm-Message-State: ALKqPwdV5eIvQLe3z0N5sljlTeatq01Cryg7AumK25TDprqUq2JWwIlt Bx7U5D/082lxDeeEIgATt1JChlON X-Google-Smtp-Source: AB8JxZr4lb5opr7XsMT55HxbyYtVIi9jPp4tsm3bDsZxzefvqv0XIFP6IutPc+hXaxd0QkDSYa8AFw== X-Received: by 2002:a62:3c10:: with SMTP id j16-v6mr3726442pfa.7.1526008084999; Thu, 10 May 2018 20:08:04 -0700 (PDT) Received: from localhost ([128.199.137.77]) by smtp.gmail.com with ESMTPSA id x25-v6sm3573081pfn.11.2018.05.10.20.08.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 May 2018 20:08:04 -0700 (PDT) From: Eryu Guan To: fstests@vger.kernel.org Cc: Dave Chinner , linux-xfs@vger.kernel.org, Eryu Guan Subject: [PATCH] xfs: pass extra params to _scratch_mkfs_xfs_opts in _scratch_mkfs_xfs Date: Fri, 11 May 2018 11:05:59 +0800 Message-Id: <20180511030559.26502-1-guaneryu@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP One of _scratch_mkfs_xfs_opts()'s job is to remove any metadata related mkfs options if mkfs.xfs binary doesn't support them, so that tests that pass metadata mkfs options to _scratch_mkfs, e.g. "_scratch_mkfs -m crc=0" won't break with old mkfs.xfs. But commit 596a068bf130 ("fstests: teach _scratch_mkfs to handle mkfs option conflicts") broke this, because it didn't pass any mkfs options to _scratch_mkfs_xfs_opts(). So fix it. Also declare a variable as 'local' and fix a typo. Reported-by: Dave Chinner Signed-off-by: Eryu Guan Reviewed-by: Dave Chinner --- common/xfs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/xfs b/common/xfs index e0bc3f43d3c5..498f45e64b6d 100644 --- a/common/xfs +++ b/common/xfs @@ -46,9 +46,9 @@ _setup_large_xfs_fs() _scratch_mkfs_xfs_opts() { - mkfs_opts=$* + local mkfs_opts=$* - # remove metadata related mkfs options if mkfs.xfs doesn't them + # remove metadata related mkfs options if mkfs.xfs doesn't support them if [ -n "$XFS_MKFS_HAS_NO_META_SUPPORT" ]; then mkfs_opts=`echo $mkfs_opts | sed "s/-m\s\+\S\+//g"` fi @@ -79,14 +79,14 @@ _scratch_mkfs_xfs_supported() _scratch_mkfs_xfs() { - local mkfs_cmd="`_scratch_mkfs_xfs_opts`" + local mkfs_cmd="`_scratch_mkfs_xfs_opts $*`" local mkfs_filter="sed -e '/less than device physical sector/d' \ -e '/switching to logical sector/d' \ -e '/Default configuration/d'" local tmp=`mktemp -u` local mkfs_status - _scratch_do_mkfs "$mkfs_cmd" "$mkfs_filter" $* 2>$tmp.mkfserr 1>$tmp.mkfsstd + _scratch_do_mkfs "$mkfs_cmd" "$mkfs_filter" 2>$tmp.mkfserr 1>$tmp.mkfsstd mkfs_status=$?