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

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