public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Chinner <david@fromorbit.com>
To: Eryu Guan <eguan@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/3] generic/009: get the correct dev name when testing ext4
Date: Tue, 22 Apr 2014 10:07:55 +1000	[thread overview]
Message-ID: <20140422000755.GH18672@dastard> (raw)
In-Reply-To: <1397708214-8197-3-git-send-email-eguan@redhat.com>

On Thu, Apr 17, 2014 at 12:16:54PM +0800, Eryu Guan wrote:
> If TEST_DEV is a symlink(usually a lvm), we get the wrong DEV
> name. Follow link and get the correct dev name.
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
>  tests/generic/009 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/generic/009 b/tests/generic/009
> index 1e487b4..7675c69 100644
> --- a/tests/generic/009
> +++ b/tests/generic/009
> @@ -51,7 +51,7 @@ testfile=$TEST_DIR/009.$$
>  
>  # Disable extent zeroing for ext4 as that change where holes are created
>  if [ "$FSTYP" = "ext4" ]; then
> -	DEV=`basename $TEST_DEV`
> +	DEV=`basename $(readlink -f $TEST_DEV)`
>  	echo 0 >/sys/fs/ext4/$DEV/extent_max_zeroout_kb
>  fi

We've made this mistake several times now. Can you add a function
in common/rc that does this. e.g. "_real_dev()" and replace
all the current 'readlink -f $DEV' calls with that function?
i.e. something like:

_real_dev()
{
	local _dev=$1
	if [ -L "$_dev" ]; then
		_dev=`readlink -f $_dev`
	fi
	echo $_dev
}

_short_dev()
{
	echo `basename $(_real_dev $1)`
}

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

      reply	other threads:[~2014-04-22  0:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17  4:16 [PATCH 1/3] common: set _fs_has_crcs=0 as default in _filter_mkfs() Eryu Guan
2014-04-17  4:16 ` [PATCH 2/3] generic/009: fix _require_xfs_io_command Eryu Guan
2014-04-17  4:16 ` [PATCH 3/3] generic/009: get the correct dev name when testing ext4 Eryu Guan
2014-04-22  0:07   ` Dave Chinner [this message]

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=20140422000755.GH18672@dastard \
    --to=david@fromorbit.com \
    --cc=eguan@redhat.com \
    --cc=xfs@oss.sgi.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