* [PATCH] common/rc: use real device name in _sysfs_dev function
@ 2016-10-11 9:40 Zorro Lang
0 siblings, 0 replies; 2+ messages in thread
From: Zorro Lang @ 2016-10-11 9:40 UTC (permalink / raw)
To: fstests
_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>
---
common/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index 7338779..821922b 100644
--- a/common/rc
+++ b/common/rc
@@ -3818,7 +3818,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)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] common/rc: use real device name in _sysfs_dev function
@ 2016-10-11 9:42 Zorro Lang
0 siblings, 0 replies; 2+ messages in thread
From: Zorro Lang @ 2016-10-11 9:42 UTC (permalink / raw)
To: fstests
_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>
---
common/rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/common/rc b/common/rc
index 7338779..821922b 100644
--- a/common/rc
+++ b/common/rc
@@ -3818,7 +3818,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)
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-11 9:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 9:42 [PATCH] common/rc: use real device name in _sysfs_dev function Zorro Lang
-- strict thread matches above, loose matches on Subject: below --
2016-10-11 9:40 Zorro Lang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox