Blame SOURCES/0513-lvm_scan.sh-use-K-when-calling-lvchange.patch

18971c
From 0fe8ed5ccb19cf5fc4a55af1b44a6664c971b5af Mon Sep 17 00:00:00 2001
18971c
From: "Bryn M. Reeves" <bmr@redhat.com>
18971c
Date: Wed, 26 Apr 2017 14:15:15 +0100
18971c
Subject: [PATCH] lvm_scan.sh: use -K when calling lvchange
18971c
18971c
The --ignoreactivationskip/-K switch was added to LVM2 in 2.02.99
18971c
(July 2013) and is used to control the activation of volumes with
18971c
the activation skip flag set: without -K these volumes will be
18971c
ignored when 'lvchange -ay $LV' is issued.
18971c
18971c
This prevents an LVM2 thin-privisioned snapshot from being used
18971c
as the root device when booting with rd.lvm.lv=vg/lv since the
18971c
activation skip flag is set for these snapshots by default (the
18971c
legacy non-thinp snapshots do not set this flag and can already
18971c
be activated and used as a root device by specifying appropriate
18971c
values for rd.lvm.lv).
18971c
18971c
This is only used in the rd.lvm.lv case since in that situation
18971c
we are activating one or more named LVs specified by the user:
18971c
the flag is not given when calling 'vgchange' since this may
18971c
cause many unwanted volumes to be activated during early user
18971c
space. Users wishing to use a specific snapshot volume should
18971c
specify it with 'rd.lvm.lv'.
18971c
18971c
Cherry-picked from: cc4e507322952532e629b98fc4de8fc1afd3ba80
18971c
Resolves: #1489841
18971c
---
18971c
 modules.d/90lvm/lvm_scan.sh | 4 ++--
18971c
 1 file changed, 2 insertions(+), 2 deletions(-)
18971c
18971c
diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
18971c
index ae6f177b..0d5fff71 100755
18971c
--- a/modules.d/90lvm/lvm_scan.sh
18971c
+++ b/modules.d/90lvm/lvm_scan.sh
18971c
@@ -109,9 +109,9 @@ if [ -n "$LVS" ] ; then
18971c
     lvm lvscan --ignorelockingfailure 2>&1 | vinfo
18971c
     for LV in $LVS; do
18971c
         if [ -z "$sysinit" ]; then
18971c
-            lvm lvchange --yes -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
18971c
+            lvm lvchange --yes -K -ay --ignorelockingfailure $nopoll --ignoremonitoring $LV 2>&1 | vinfo
18971c
         else
18971c
-            lvm lvchange --yes -ay $sysinit $LV 2>&1 | vinfo
18971c
+            lvm lvchange --yes -K -ay $sysinit $LV 2>&1 | vinfo
18971c
         fi
18971c
     done
18971c
 fi