xfstests: Fix hang when mkfs.btrfs isn't present
diff mbox

Message ID 513674B2.9030900@sandeen.net
State Not Applicable
Headers show

Commit Message

Eric Sandeen March 5, 2013, 10:41 p.m. UTC
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>
---



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Rich Johnston March 6, 2013, 1:03 p.m. UTC | #1
This patch has been committed.

Thanks
--Rich

commit 52f4953ac4a377f9f7fc870d2a81f30c3e5d3c7f
Author: Eric Sandeen <sandeen@sandeen.net>
Date:   Tue Mar 5 22:41:54 2013 +0000

     xfstests: Fix hang when mkfs.btrfs isn't present

     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>
     Reviewed-by: Rich Johnston <rjohnston@sgi.com>
     Signed-off-by: Rich Johnston <rjohnston@sgi.com>

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

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