]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
common/rc: use real device name in _sysfs_dev function
authorZorro Lang <zlang@redhat.com>
Tue, 11 Oct 2016 09:40:39 +0000 (17:40 +0800)
committerEryu Guan <eguan@redhat.com>
Tue, 11 Oct 2016 10:30:38 +0000 (18:30 +0800)
_sysfs_dev try to find the major and minor device numbers of
SCRATCH_DEV, by 'stat -c%t $SCRATCH_DEV' and 'stat -c%T
$SCRATCH_DEV'.

But if the SCRATCH_DEV is symlink (e.g: /dev/mapper/
testvg-scratchdev), stat command can't find correct device numbers.
So try to find the real name of the SCRATCH_DEV at first.

Signed-off-by: Zorro Lang <zlang@redhat.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
common/rc

index c3da064a34033d96d7078cf38df7021deb0a7f96..7a9fc908f4e7e7d7230ac5113ac42c9572fca234 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -3823,7 +3823,7 @@ _short_dev()
 
 _sysfs_dev()
 {
-       local _dev=$1
+       local _dev=`_real_dev $1`
        local _maj=$(stat -c%t $_dev | tr [:lower:] [:upper:])
        local _min=$(stat -c%T $_dev | tr [:lower:] [:upper:])
        _maj=$(echo "ibase=16; $_maj" | bc)