From: Heinz Mauelshagen <heinzm@redhat.com>
To: lvm-devel@redhat.com
Subject: vgchange.c gets dmeventd monitoring activation wrong
Date: Wed, 10 Mar 2010 18:43:23 +0100 [thread overview]
Message-ID: <1268243003.3074.62.camel@o> (raw)
Updating to Fedora 12 kernel 2.6.32.9-67.fc12.x86_64 I was left
with no root device.
Reason was, that we don't get dmeventd device monitoring activation
(deactivation in this case rather) right, hence causing dlopen on
libdevemapper-event DSO(s) via the dmeventd call chain.
The DSOs are intentionally not part of the initramfs for obvious
reasons, which should be respected by the fact, that we call "vgchange
--monitor n" from dracut's lvm_scan script.
This patch is a proposal to fix the dmeventd activation handling via the
"--ignoremonitoring" and the "--monitor {y|n}"
options and is not tested yet.
It give precedence to the "--ignoremonitoring" option over the other
one, which makes more sense IMO and needs a vgchange(8) manual change to
reflect this.
Of course we should better raise a command line error if both are given,
which is subject to future discussion.
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
---
LVM2.2.02.53/tools/{vgchange.c.orig => vgchange.c} | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git LVM2.2.02.53/tools/vgchange.c.orig LVM2.2.02.53/tools/vgchange.c
index 95b0b48..e789cc4 100644
--- LVM2.2.02.53/tools/vgchange.c.orig
+++ LVM2.2.02.53/tools/vgchange.c
@@ -494,16 +494,24 @@ static int vgchange_single(struct cmd_context *cmd, const char *vg_name,
struct volume_group *vg,
void *handle __attribute((unused)))
{
- int r = ECMD_FAILED;
+ int dmeventd_mode, r = ECMD_FAILED;
if (vg_is_exported(vg)) {
log_error("Volume group \"%s\" is exported", vg_name);
return ECMD_FAILED;
}
- init_dmeventd_monitor(arg_int_value(cmd, monitor_ARG,
- (is_static() || arg_count(cmd, ignoremonitoring_ARG)) ?
- DMEVENTD_MONITOR_IGNORE : DEFAULT_DMEVENTD_MONITOR));
+ /* Check conditions to activate dmeventd montoring. */
+ if (is_static())
+ dmeventd_mode = DMEVENTD_MONITOR_IGNORE;
+ else if (arg_count(cmd, ignoremonitoring_ARG))
+ dmeventd_mode = DMEVENTD_MONITOR_IGNORE;
+ else if (!arg_int_value(cmd, monitor_ARG, 1))
+ dmeventd_mode = DMEVENTD_MONITOR_IGNORE;
+ else
+ dmeventd_mode = DEFAULT_DMEVENTD_MONITOR;
+
+ init_dmeventd_monitor(dmeventd_mode);
if (arg_count(cmd, available_ARG))
r = _vgchange_available(cmd, vg);
next reply other threads:[~2010-03-10 17:43 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-10 17:43 Heinz Mauelshagen [this message]
2010-03-10 18:08 ` vgchange.c gets dmeventd monitoring activation wrong Heinz Mauelshagen
2010-03-10 18:24 ` Heinz Mauelshagen
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=1268243003.3074.62.camel@o \
--to=heinzm@redhat.com \
--cc=lvm-devel@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.