public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <guaneryu@gmail.com>
To: fstests@vger.kernel.org
Cc: Dave Chinner <david@fromorbit.com>,
	linux-xfs@vger.kernel.org, Eryu Guan <guaneryu@gmail.com>
Subject: [PATCH] xfs: pass extra params to _scratch_mkfs_xfs_opts in _scratch_mkfs_xfs
Date: Fri, 11 May 2018 11:05:59 +0800	[thread overview]
Message-ID: <20180511030559.26502-1-guaneryu@gmail.com> (raw)

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 <dchinner@redhat.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
---
 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=$?
 
 
-- 
2.17.0


             reply	other threads:[~2018-05-11  3:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-11  3:05 Eryu Guan [this message]
2018-05-21  9:39 ` [PATCH] xfs: pass extra params to _scratch_mkfs_xfs_opts in _scratch_mkfs_xfs Eryu Guan
2018-05-21 22:32 ` Dave Chinner
2018-05-23  2:01   ` Eryu Guan
2018-05-23 10:46     ` Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180511030559.26502-1-guaneryu@gmail.com \
    --to=guaneryu@gmail.com \
    --cc=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox