public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Stefan Behrens <sbehrens@giantdisaster.de>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	xfs-oss <xfs@oss.sgi.com>
Subject: [PATCH] xfstests: Fix hang when mkfs.btrfs isn't present
Date: Tue, 05 Mar 2013 16:41:54 -0600	[thread overview]
Message-ID: <513674B2.9030900@sandeen.net> (raw)
In-Reply-To: <512D1E3E.9050907@redhat.com>

My earlier patch (xfstests: handle new mkfs.btrfs -f option cleanly)
had a flaw in that if set_prog_path mkfs.btrfs returns nothing,
the grep will hang.

Test for that case to avoid it, and just return the empty string
in that case.

Reported-by: Rich Johnston <rjohnston@sgi.com>
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/common.config b/common.config
index c10163a..a0b017d 100644
--- a/common.config
+++ b/common.config
@@ -108,7 +108,7 @@ set_prog_path()
 set_btrfs_mkfs_prog_path_with_opts()
 {
 	p=`set_prog_path mkfs.btrfs`
-	if grep -q 'force overwrite' $p; then
+	if [ "$p" != "" ] && grep -q 'force overwrite' $p; then
 		echo "$p -f"
 	else
 		echo $p


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  parent reply	other threads:[~2013-03-05 22:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-26 20:42 [PATCH] xfstests: handle new mkfs.btrfs -f option cleanly Eric Sandeen
2013-03-05 20:23 ` Rich Johnston
2013-03-05 22:41 ` Eric Sandeen [this message]
2013-03-05 22:47   ` [PATCH] xfstests: Fix hang when mkfs.btrfs isn't present Rich Johnston
2013-03-06 13:03   ` Rich Johnston

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=513674B2.9030900@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=sbehrens@giantdisaster.de \
    --cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox