multipath/module-setup.sh: fix host-only/mount checks
authorHarald Hoyer <harald@redhat.com>
Wed, 25 Apr 2012 09:23:49 +0000 (11:23 +0200)
committerHarald Hoyer <harald@redhat.com>
Wed, 25 Apr 2012 13:58:40 +0000 (15:58 +0200)
modules.d/90multipath/module-setup.sh

index 2bc1b41..2af112a 100755 (executable)
@@ -11,18 +11,16 @@ check() {
     [[ $debug ]] && set -x
 
     is_mpath() {
-        [ -e /sys/dev/block/$1/dm/uuid ] || return 1
-        [[ $(cat /sys/dev/block/$1/dm/uuid) =~ ^mpath- ]] && return 0
+        local _dev
+        _dev=$(get_maj_min $1)
+        [ -e /sys/dev/block/$_dev/dm/uuid ] || return 1
+        [[ $(cat /sys/dev/block/$_dev/dm/uuid) =~ ^mpath- ]] && return 0
         return 1
     }
 
-    if [[ $hostonly ]]; then
-        _rootdev=$(find_root_block_device)
-        if [[ $_rootdev ]]; then
-            check_block_and_slaves is_mpath "$_rootdev" && return 0
-        fi
-        return 1
-    fi
+    [[ $hostonly ]] || [[ $mount_needs ]] && {
+        for_each_host_dev_fs is_mpath || return 1
+    }
 
     return 0
 }