_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>
_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)