From patchwork Tue Oct 11 09:40:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zorro Lang X-Patchwork-Id: 9370311 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4B77260487 for ; Tue, 11 Oct 2016 09:45:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4CD0E29C39 for ; Tue, 11 Oct 2016 09:45:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4181C29C3B; Tue, 11 Oct 2016 09:45:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D261529C3F for ; Tue, 11 Oct 2016 09:45:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752605AbcJKJmb (ORCPT ); Tue, 11 Oct 2016 05:42:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:63509 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752647AbcJKJlp (ORCPT ); Tue, 11 Oct 2016 05:41:45 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 01BDF3D95D for ; Tue, 11 Oct 2016 09:40:51 +0000 (UTC) Received: from dhcp-12-101.nay.redhat.com (dhcp-12-101.nay.redhat.com [10.66.12.101]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9B9enN4020318 for ; Tue, 11 Oct 2016 05:40:50 -0400 From: Zorro Lang To: fstests@vger.kernel.org Subject: [PATCH] common/rc: use real device name in _sysfs_dev function Date: Tue, 11 Oct 2016 17:40:39 +0800 Message-Id: <1476178839-27545-1-git-send-email-zlang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 11 Oct 2016 09:40:51 +0000 (UTC) Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP _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 --- 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)