Blame SOURCES/0062-lvm-fixed-lvm-thin-check.patch

18971c
From 793beab60c416e0edf7331fa2e6881b08f2bece0 Mon Sep 17 00:00:00 2001
18971c
From: Harald Hoyer <harald@redhat.com>
18971c
Date: Fri, 13 Dec 2013 11:05:39 +0100
18971c
Subject: [PATCH] lvm: fixed lvm thin check
18971c
18971c
---
18971c
 modules.d/90lvm/module-setup.sh | 9 ++++++++-
18971c
 1 file changed, 8 insertions(+), 1 deletion(-)
18971c
18971c
diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh
18971c
index 877631bb..f0c9b964 100755
18971c
--- a/modules.d/90lvm/module-setup.sh
18971c
+++ b/modules.d/90lvm/module-setup.sh
18971c
@@ -97,9 +97,16 @@ install() {
18971c
 
18971c
     if [[ $hostonly ]] && type -P lvs &>/dev/null; then
18971c
         for dev in "${!host_fs_types[@]}"; do
18971c
-            if [[ "$(lvs --noheadings -o segtype "$dev" 2>/dev/null)" == *thin* ]] ; then
18971c
+            [ -e /sys/block/${dev#/dev/}/dm/name ] || continue
18971c
+            dev=$(
18971c
+            eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
18971c
+            [[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || continue
18971c
+            if [[ "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" == *thin* ]] ; then
18971c
                 inst_multiple -o thin_dump thin_restore thin_check thin_repair
18971c
+                break
18971c
             fi
18971c
         done
18971c
+    else
18971c
+        inst_multiple -o thin_dump thin_restore thin_check thin_repair
18971c
     fi
18971c
 }