]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
xfstests: Fix hang when mkfs.btrfs isn't present
authorEric Sandeen <sandeen@sandeen.net>
Tue, 5 Mar 2013 22:41:54 +0000 (22:41 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 6 Mar 2013 12:59:32 +0000 (06:59 -0600)
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>
common.config

index c10163a8d0d70001bf1f795c3b43b709ec8b80cd..a0b017d7e7a94fb67a02702550c1f380a73999b6 100644 (file)
@@ -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