Skip to contentSkip to conversation

modules: lvm: fix activationskip check

PATCH In review Nicolai Stange 2 participants 2 messages Jun 25, 2015 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 modules: lvm: fix activationskip check

Fix boot breakage due to the activationskip check introduced in cfa365a32d47 ("lvm: Don't activate LVs with activationskip set").

In 'man 8 lvs', it is stated that LVs with activationskip set, will have a "k" flag in their lvs attribute listing.

The current implementation excludes LVs which do not have the "k" flag set. This leads to the activation of LVs with the activationskip set and the exclusion of LVs with no activationskip set: the check's logic is inverted.

Fix this issue by skipping those LVs that have the "k" flag in their attributes.

---
 modules.d/90lvm/lvm_scan.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
modules.d/90lvm/lvm_scan.sh +1 -1
index ce46e14..ba7d738 100755
@@ -106,7 +106,7 @@ if [ -n "$LVS" ] ; then
     info "Scanning devices $lvmdevs for LVM logical volumes $LVS"
     lvm lvscan --ignorelockingfailure 2>&1 | vinfo
     for LV in $LVS; do
-        if [ "x$(lvm lvs --noheadings --select "lv_attr =~ k" $LV | wc -l)" = "x0" ]; then
+        if [ "x$(lvm lvs --noheadings --select "lv_attr =~ k" $LV | wc -l)" != "x0" ]; then
             info "Skipping activation of '$LV' because activationskip is set."
             continue
         fi
Signature · 1 line
2.4.4