All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Zorro Lang <zlang@redhat.com>
Cc: fstests@vger.kernel.org, shiina.hironori@gmail.com
Subject: [PATCH] common/xfs: use whole-word matching for _require_xfsrestore_xflag
Date: Tue, 7 Feb 2023 09:00:12 -0800	[thread overview]
Message-ID: <Y+KDnDHVCKK07yzI@magnolia> (raw)

From: Darrick J. Wong <djwong@kernel.org>

On my system, the path to the xfsrestore binary is:

/code/xfsdump/build-x86_64/restore/xfsrestore

The grep command in _require_xfsrestore_xflag matches on the "build-x86"
part, even though my version of xfsrestore does not actually have a -x
flag.  Fix the string parsing to match entire words so that we only look
for -x in the help output.

(Maybe someone should patch xfsrestore -h to report basename(argv[0])
instead of argv[0]...)

Fixes: 1ffa16c573 ("xfs: test for fixing wrong root inode number in dump")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 common/xfs |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/xfs b/common/xfs
index ba59889c3b..97c049e2ca 100644
--- a/common/xfs
+++ b/common/xfs
@@ -1529,7 +1529,7 @@ _xfs_filter_mkfs()
 
 _require_xfsrestore_xflag()
 {
-	$XFSRESTORE_PROG -h 2>&1 | grep -q -e '-x' || \
+	$XFSRESTORE_PROG -h 2>&1 | grep -q -w -e '-x' || \
 			_notrun 'xfsrestore does not support -x flag.'
 }
 

             reply	other threads:[~2023-02-07 17:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 17:00 Darrick J. Wong [this message]
2023-02-09 15:18 ` [PATCH] common/xfs: use whole-word matching for _require_xfsrestore_xflag Zorro Lang

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=Y+KDnDHVCKK07yzI@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=shiina.hironori@gmail.com \
    --cc=zlang@redhat.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.