xfs
[Top] [All Lists]

Re: [PATCH V3] xfstests: use stat not lstat when examining devices

To: Eric Sandeen <sandeen@xxxxxxxxxxx>
Subject: Re: [PATCH V3] xfstests: use stat not lstat when examining devices
From: Alex Elder <aelder@xxxxxxx>
Date: Fri, 04 Jun 2010 13:26:50 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <4C093F22.1010006@xxxxxxxxxxx>
References: <4C091B4E.5030503@xxxxxxxxxxx> <4C0939B9.9000109@xxxxxxxxxxx> <4C093F22.1010006@xxxxxxxxxxx>
Reply-to: aelder@xxxxxxx
On Fri, 2010-06-04 at 13:00 -0500, Eric Sandeen wrote:
> If you try running xfstests on lvm volumes which are symlinks,
> it'll fail to run several tests because our _require_scratch 
> framework ultimately uses lstat not stat, and does not think 
> the lvm device (which is usually a symlink to a dm-X device) 
> is a block device.  Sigh.
> 
> Just calling stat(1) with -L to follow the link should
> suffice.

I wonder whether we'll find stat(1) output ever varies
enough to affect this.

But otherwise this looks good to me.

Reviewed-by: Alex Elder <aelder@xxxxxxx>

> Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
> ---
> 
> diff --git a/common.rc b/common.rc
> index 6bf1e12..db18884 100644
> --- a/common.rc
> +++ b/common.rc
> @@ -584,7 +584,7 @@ _is_block_dev()
>       exit 1
>      fi
>  
> -    [ -b $1 ] && src/lstat64 $1 | $AWK_PROG '/Device type:/ { print $9 }'
> +    [ -b $1 ] && stat -L $1 | $AWK_PROG '/Device type:/ { print $9 }'
>  }
>  
>  # Do a command, log it to $seq.full, optionally test return status
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs



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