From patchwork Tue Mar 5 22:41:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2222491 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C69B53FCF6 for ; Tue, 5 Mar 2013 22:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755507Ab3CEWvW (ORCPT ); Tue, 5 Mar 2013 17:51:22 -0500 Received: from sandeen.net ([63.231.237.45]:48243 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755104Ab3CEWvW (ORCPT ); Tue, 5 Mar 2013 17:51:22 -0500 X-Greylist: delayed 567 seconds by postgrey-1.27 at vger.kernel.org; Tue, 05 Mar 2013 17:51:22 EST Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTPSA id 7B10163C59BB; Tue, 5 Mar 2013 16:41:54 -0600 (CST) Message-ID: <513674B2.9030900@sandeen.net> Date: Tue, 05 Mar 2013 16:41:54 -0600 From: Eric Sandeen User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130216 Thunderbird/17.0.3 MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss , linux-btrfs , Stefan Behrens Subject: [PATCH] xfstests: Fix hang when mkfs.btrfs isn't present References: <512D1E3E.9050907@redhat.com> In-Reply-To: <512D1E3E.9050907@redhat.com> X-Enigmail-Version: 1.5.1 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org 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 Signed-off-by: Eric Sandeen --- -- 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 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