From: Petr Rockai <prockai@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Avoid recursive calls from dmeventd to itself
Date: Fri, 02 Sep 2011 14:50:13 +0200 [thread overview]
Message-ID: <87ippb2jne.fsf@aldalome.int.mornfall.net.> (raw)
In-Reply-To: <20110901194235.GA4025@agk-dp.fab.redhat.com> (Alasdair G. Kergon's message of "Thu, 1 Sep 2011 20:42:35 +0100")
Alasdair G Kergon <agk@redhat.com> writes:
> On Thu, Sep 01, 2011 at 03:08:03AM +0200, Peter Rockai wrote:
>> - lvm2_run(_lvm_handle, "_memlock_dec");
>> + lvm2_run(_lvm_handle, "_dmeventd_leave");
>
> I'm not keen on overloading it like that.
>
> If it's being used with cmdlib and lvm2_run, use of existing cmdline parameters
> ought to be sufficient to achieve this.
While that is true, I doubt it is a good idea. If we say that dmeventd
is not supposed to call itself recursively (which I believe is the
correct approach), we should enforce that globally. Asking every call
site to take care of this individually is error prone and bound to
introduce the bug sooner or later (especially with the rampant
copy-and-paste programming found in LVM :\).
> It might be a little more code, but I'd rather see it a property of the handle
> never to perform dmeventd monitoring calls. We never fixed handle init to
> take multiple settings, so maybe call
> void lvm2_disable_dmeventd_monitoring(void *handle)
> after handle initialisation to set DMEVENTD_MONITOR_DISABLED and have that take
> precedence over any later attempt to enable monitoring.
This sounds like a better option. Now that raises the question why we
aren't doing the same thing for memlock_{inc,dec}? We should certainly
unify these two things. I'll have a look, and unless I run into a
stumbling block will submit a patch to do that.
(Of course, it would be much better if we could instead move dmeventd
plugins over to using liblvm2api (replacing liblvm2cmd), but I suspect
there's a lot of stuff to resolve before we can hit that mark.)
Petr
--
id' Ash = Ash; id' Dust = Dust; id' _ = undefined
next prev parent reply other threads:[~2011-09-02 12:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 1:08 [PATCH] Avoid recursive calls from dmeventd to itself Petr Rockai
2011-09-01 19:42 ` Alasdair G Kergon
2011-09-02 12:50 ` Petr Rockai [this message]
2011-10-10 14:33 ` Petr Rockai
2011-10-18 12:56 ` Milan Broz
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=87ippb2jne.fsf@aldalome.int.mornfall.net. \
--to=prockai@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.