From: Mike Snitzer <snitzer@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] allow disabled dmeventd monitoring to propagate via clvmd
Date: Thu, 25 Mar 2010 22:59:07 -0400 [thread overview]
Message-ID: <20100326025907.GA17663@redhat.com> (raw)
In-Reply-To: <20100325215100.GA27929@redhat.com>
The lvm commands that control dmeventd monitoring (lvchange, vgchange,
lvcreate) now properly establish the '_dmeventd_monitor' via commandline
of lvm.conf -- they in turn pass their setting on to clvmd through
_lock_for_cluster().
So we really don't have a need to init_dmeventd_monitor() based on
lvm.conf when creating or refreshing the toolcontext -- especially not
for clvmd's benefit.
And all existing dmeventd_monitor_mode() callers properly account for it
returning tri-state (except for _lock_for_cluster() -- it treating it as
a binary return didn't dawn on me until I wasted too much time tracing
this issue).
I've tested this minimalist patch quite a bit:
clvmd's do_lock_lv() already properly controls dmeventd monitoring based
on LCK_DMEVENTD_MONITOR_MODE in lock_flags -- though one small fix was
needed for this to work: _lock_for_cluster() must treat
dmeventd_monitor_mode()'s return as a tri-state value.
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---
diff --git a/lib/locking/cluster_locking.c b/lib/locking/cluster_locking.c
index b82b077..f98f445 100644
--- a/lib/locking/cluster_locking.c
+++ b/lib/locking/cluster_locking.c
@@ -307,6 +307,7 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
char *args;
const char *node = "";
int len;
+ int dmeventd_mode;
int saved_errno = errno;
lvm_response_t *response = NULL;
int num_responses;
@@ -324,7 +325,8 @@ static int _lock_for_cluster(struct cmd_context *cmd, unsigned char clvmd_cmd,
if (mirror_in_sync())
args[1] |= LCK_MIRROR_NOSYNC_MODE;
- if (dmeventd_monitor_mode())
+ dmeventd_mode = dmeventd_monitor_mode();
+ if (dmeventd_mode != DMEVENTD_MONITOR_IGNORE && dmeventd_mode)
args[1] |= LCK_DMEVENTD_MONITOR_MODE;
if (cmd->partial_activation)
prev parent reply other threads:[~2010-03-26 2:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-23 19:23 [PATCH v2] improve activation monitoring option processing Mike Snitzer
2010-03-24 8:49 ` Milan Broz
2010-03-24 9:19 ` Milan Broz
2010-03-24 13:07 ` Mike Snitzer
2010-03-24 15:44 ` Mike Snitzer
2010-03-25 21:51 ` Mike Snitzer
2010-03-26 2:59 ` Mike Snitzer [this message]
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=20100326025907.GA17663@redhat.com \
--to=snitzer@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.