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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

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@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux