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

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