public inbox for initramfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolai Stange <nicstange-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] modules: lvm: fix activationskip check
Date: Thu, 25 Jun 2015 14:56:54 +0200	[thread overview]
Message-ID: <87zj3ot089.fsf@gmail.com> (raw)

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.

Signed-off-by: Nicolai Stange <nicstange-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 modules.d/90lvm/lvm_scan.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules.d/90lvm/lvm_scan.sh b/modules.d/90lvm/lvm_scan.sh
index ce46e14..ba7d738 100755
--- a/modules.d/90lvm/lvm_scan.sh
+++ b/modules.d/90lvm/lvm_scan.sh
@@ -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
-- 
2.4.4

             reply	other threads:[~2015-06-25 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-25 12:56 Nicolai Stange [this message]
     [not found] ` <87zj3ot089.fsf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-06-25 13:03   ` [PATCH] modules: lvm: fix activationskip check Dracut GitHub Import Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj3ot089.fsf@gmail.com \
    --to=nicstange-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=initramfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox