All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH v2] improve activation monitoring option processing
Date: Wed, 24 Mar 2010 11:44:05 -0400	[thread overview]
Message-ID: <20100324154359.GA845@redhat.com> (raw)
In-Reply-To: <20100324130736.GA19258@redhat.com>

On Wed, Mar 24 2010 at  9:07am -0400,
Mike Snitzer <snitzer@redhat.com> wrote:

> On Wed, Mar 24 2010 at  5:19am -0400,
> Milan Broz <mbroz@redhat.com> wrote:
> 
> > 
> > 
> > On 03/23/2010 08:23 PM, Mike Snitzer wrote:
> > > Add "monitoring" option to "activation" section of lvm.conf
> > >
> > > Have clvmd consult the lvm.conf "activation/monitoring" too.
> > please do it something like this... (untested)
> 
> OK, I already committed that other patch (got ack to do so).
> 
> Your patch looks good.  I had some doubts about checking lvm.conf like I
> did in do_lock_query (but didn't explicitly share as much).

Update _process_config() to establish '_dmeventd_monitor' global based
on lvm.conf.  This allows clvmd's calls to create_toolcontext() and
refresh_toolcontext() to (re)establish dmeventd monitoring based on
lvm.conf (rather than always using DEFAULT_DMEVENTD_MONITOR).

clvmd's do_lock_lv() already properly controls dmeventd monitoring based
on LCK_DMEVENTD_MONITOR_MODE in lock_flags -- which currently gets set
based on the '_dmeventd_monitor' global.

Follow-on work will tie command line overrides into the command context
to allow clvmd's dmeventd monitoring to be controlled from the
commandline.  So clvmd will consult the command context for dmeventd
monitoring mode rather than looking at the global (which is process
specific).

Signed-off-by: Mike Snitzer <snitzer@redhat.com>
---

diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index 60b6db4..3060954 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -542,12 +542,8 @@ int do_lock_lv(unsigned char command, unsigned char lock_flags, char *resource)
 	if (lock_flags & LCK_MIRROR_NOSYNC_MODE)
 		init_mirror_in_sync(0);
 
-	if (!(lock_flags & LCK_DMEVENTD_MONITOR_MODE)) {
-		int dmeventd_mode =
-			find_config_tree_bool(cmd, "activation/monitoring",
-					      DEFAULT_DMEVENTD_MONITOR);
-		init_dmeventd_monitor(dmeventd_mode);
-	}
+	if (!(lock_flags & LCK_DMEVENTD_MONITOR_MODE))
+		init_dmeventd_monitor(1);
 
 	cmd->partial_activation = 0;
 
diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 7aac361..94375de 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -281,6 +281,10 @@ static int _process_config(struct cmd_context *cmd)
 						  "activation/missing_stripe_filler",
 						  DEFAULT_STRIPE_FILLER);
 
+	init_dmeventd_monitor(find_config_tree_bool(cmd,
+						    "activation/monitoring",
+						    DEFAULT_DMEVENTD_MONITOR));
+
 	/* FIXME Missing error code checks from the stats, not log_warn?, notify if setting overridden, delay message/check till it is actually used (eg consider if lvm shell - file could appear later after this check)? */
 	if (!strcmp(cmd->stripe_filler, "/dev/ioerror") &&
 	    stat(cmd->stripe_filler, &st))



  reply	other threads:[~2010-03-24 15:44 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 [this message]
2010-03-25 21:51       ` Mike Snitzer
2010-03-26  2:59         ` [PATCH] allow disabled dmeventd monitoring to propagate via clvmd Mike Snitzer

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=20100324154359.GA845@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.