[PATCH 3/3] generic/009: get the correct dev name when testing ext4
Dave Chinner
david at fromorbit.com
Mon Apr 21 19:07:55 CDT 2014
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 at 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 at fromorbit.com
More information about the xfs
mailing list