]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
90dm: fixup dependency cycle between MD and DM shutdown 323/head
authorHannes Reinecke <hare@suse.de>
Thu, 25 Aug 2016 07:49:14 +0000 (09:49 +0200)
committerDaniel Molkentin <dmolkentin@suse.com>
Fri, 15 Dec 2017 19:55:37 +0000 (20:55 +0100)
DM devices might be located on top of MD devices, so we need to
call the DM shutdown script before MD shutdown. The exception
here are multipath devices, which are below MD devices.
So skip removing multipath devices here to avoid spurious errors.

References: bsc#994860

Signed-off-by: Hannes Reinecke <hare@suse.com>
modules.d/90dm/dm-shutdown.sh
modules.d/90dm/module-setup.sh

index 4e2e2602c8c43a0c70f4d3436ace4a34c23fd741..b23836f4e27331bcf9600d5f74ff33c0e78206fc 100755 (executable)
@@ -9,8 +9,18 @@ _remove_dm() {
         [ -e ${s} ] || continue
         _remove_dm ${s##*/}
     done
-    devname=$(cat /sys/block/${dev}/dm/name)
-    dmsetup -v --noudevsync remove "$devname" || return $?
+    # multipath devices might have MD devices on top,
+    # which are removed after this script. So do not
+    # remove those to avoid spurious errors
+    case $(cat /sys/block/${dev}/dm/uuid) in
+        mpath-*)
+            return 0
+            ;;
+        *)
+            devname=$(cat /sys/block/${dev}/dm/name)
+            dmsetup -v --noudevsync remove "$devname" || return $?
+            ;;
+    esac
     return 0
 }
 
index 2b8e39ff8ed9e095ee23a7f304e80d34d294c798..02d97c24e4546f11888bb6bbe2166f04834504c0 100755 (executable)
@@ -38,6 +38,6 @@ install() {
     inst_rules "$moddir/59-persistent-storage-dm.rules"
     prepare_udev_rules 59-persistent-storage-dm.rules
 
-    inst_hook shutdown 30 "$moddir/dm-shutdown.sh"
+    inst_hook shutdown 25 "$moddir/dm-shutdown.sh"
 }