xfs
[Top] [All Lists]

Re: [PATCH] xfstests: support post-udev device mapper nodes

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH] xfstests: support post-udev device mapper nodes
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Mon, 2 May 2011 15:35:42 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <1304364779.3077.41.camel@doink>
References: <20110502160232.GA14457@xxxxxxxxxxxxx> <1304364779.3077.41.camel@doink>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, May 02, 2011 at 02:32:59PM -0500, Alex Elder wrote:
> I'm not 100% sure I'm parsing the above right.  What
> I read is that, although we want to use the "real"
> device (not the link), the utilities tend to report
> the /dev/mapper names.  Therefore we want to use
> /dev/mapper names and internally translate them to
> their real devices.

We as in xfstests want to use whatever everyone else uses to make
our life easier for parsing mount table output, df output, etc,
and that's normally the /dev/mapper/ name.  The only thing that
can't cope with the symlink there is the _is_block_dev helper.

> > +    _dev=$1
> > +    if [ -L ${_dev} ]; then
> > +        _dev=`readlink -f ${_dev}`
> 
> Although it typically shouldn't, if the "readlink -f" fails,
> it will make _dev have an empty value...
> 
> > +    fi
> > +
> > +    if [ -b ${_dev} ]; then
> 
> ...which will lead to some sort of shell "syntax error"
> message here, which is rather unhelpful.
> 
> At a minimum, I think putting quotes around it here
> would avoid that (but you should test), i.e.,
>     if [ -b "${_dev}" ]; then

Ok.

> This and the next one appear to be junk that should
> be removed.

Indeed.

<Prev in Thread] Current Thread [Next in Thread>