public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Zorro Lang <zlang@redhat.com>
To: fstests@vger.kernel.org
Subject: [PATCH] common/rc: use real device name in _sysfs_dev function
Date: Tue, 11 Oct 2016 17:42:22 +0800	[thread overview]
Message-ID: <1476178942-27665-1-git-send-email-zlang@redhat.com> (raw)

_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


             reply	other threads:[~2016-10-11  9:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-11  9:42 Zorro Lang [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-11  9:40 [PATCH] common/rc: use real device name in _sysfs_dev function Zorro Lang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1476178942-27665-1-git-send-email-zlang@redhat.com \
    --to=zlang@redhat.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox