From f4075ecd99eaabed88c7de25cb6558292b5d447a Mon Sep 17 00:00:00 2001 From: Anoob Soman Date: Wed, 2 Sep 2015 17:02:01 +0100 Subject: [PATCH] CA-181447: Fix checking of node minor stat --format=%T returns minor device type in hex and this value is compared against ROOT_DISK_MINOR which is decimal. Convert value returned by stat %T to decimal, before doing the comparison. Signed-off-by: Anoob Soman Reviewed-by: Germano Percossi --- multipath/sm-multipath | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multipath/sm-multipath b/multipath/sm-multipath index c58e51c18..f1ed516c3 100755 --- a/multipath/sm-multipath +++ b/multipath/sm-multipath @@ -71,7 +71,8 @@ start() { ROOT_DISK_MINOR=${ROOT_PART_SLAVE#dm-} MPATH_NODES="$(dmsetup ls --target multipath --exec ls)" for n in $MPATH_NODES ; do - NODE_MINOR="$(stat -L --format=%T $n)" + # stat %T returns value in hex, convert to decimal before comparing + NODE_MINOR="$((0x$(stat -L --format=%T $n)))" if [ "$ROOT_DISK_MINOR" = "$NODE_MINOR" ] ; then mkdir -p /dev/disk/mpInuse ln -sf $n /dev/disk/mpInuse