From: Zorro Lang Date: Tue, 11 Oct 2016 09:40:39 +0000 (+0800) Subject: common/rc: use real device name in _sysfs_dev function X-Git-Tag: v2022.05.01~2329 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=8425118bff45505ed43f8a41c2d82033b0293aed;p=users%2Fhch%2Fxfstests-dev.git common/rc: use real device name in _sysfs_dev function _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 Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- diff --git a/common/rc b/common/rc index c3da064a3..7a9fc908f 100644 --- 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)