FS/XFS testing framework
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Zhaolei <zhaolei@cn.fujitsu.com>
Cc: fstests@vger.kernel.org
Subject: Re: [PATCH] Fix warning of "Usage: _is_block_dev dev"
Date: Mon, 16 Feb 2015 10:04:54 +1100	[thread overview]
Message-ID: <20150215230454.GF12722@dastard> (raw)
In-Reply-To: <1423745294-20408-1-git-send-email-zhaolei@cn.fujitsu.com>

On Thu, Feb 12, 2015 at 08:48:14PM +0800, Zhaolei wrote:
> From: Zhao Lei <zhaolei@cn.fujitsu.com>
> 
> _is_block_dev() will show above warning when "$dev" is not exist.
> It happened when user hadn't set $SCRATCH_DEV(optional) and check
> $TEST_DEV.

_is_block_dev() is used in many places to check whether the block
device exists.  i.e. I'd suggest that _is_block_dev() should return
an empty string to indicate it's not a block device rather than exit
if a null. That means we don't have to execute _is_block_dev() in a
subshell (i.e. via `_is_block_dev ...`) to prevent it from killing
the script that runs it if the block device passed to it is null.

That means we don't have to add checks everywhere it is called, and
we can simplify the calling convention at the same time....

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

  reply	other threads:[~2015-02-15 23:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12 12:48 [PATCH] Fix warning of "Usage: _is_block_dev dev" Zhaolei
2015-02-15 23:04 ` Dave Chinner [this message]
2015-02-16  2:27   ` Zhao Lei
2015-02-16  5:23     ` Dave Chinner

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=20150215230454.GF12722@dastard \
    --to=david@fromorbit.com \
    --cc=fstests@vger.kernel.org \
    --cc=zhaolei@cn.fujitsu.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