* [PATCH] udev: move notify rule
@ 2009-10-30 14:51 Bastian Blank
2009-10-30 15:54 ` Peter Rajnoha
0 siblings, 1 reply; 4+ messages in thread
From: Bastian Blank @ 2009-10-30 14:51 UTC (permalink / raw)
To: lvm-devel
Move notify rule into the first rules file. The RUN commands is executed
after everything is finished, so it makes no difference if it is set
early or late.
diff --git a/udev/10-dm.rules.in b/udev/10-dm.rules.in
index 9c2e256..211011c 100644
--- a/udev/10-dm.rules.in
+++ b/udev/10-dm.rules.in
@@ -26,6 +26,12 @@ TEST!="$env{DM_SBIN_PATH}/dmsetup", GOTO="dm_end"
# kernels >= 2.6.31 only.
ENV{DM_COOKIE}=="?*", IMPORT{program}="$env{DM_SBIN_PATH}/dmsetup udevflags $env{DM_COOKIE}"
+# These rules are responsible for sending a notification to a process
+# waiting for completion of udev rules. The process is identified by
+# a cookie value sent within "change" and "remove" events (the cookie
+# value is set before by that process for every action requested).
+ACTION=="change|remove", ENV{DM_COOKIE}=="?*", RUN+="$env{DM_SBIN_PATH}/dmsetup udevcomplete $env{DM_COOKIE}"
+
# Normally, we would test for DM_UDEV_DISABLE_DM_RULES_FLAG here and skip
# the rules if set. However, we need to set DM_* environment variables
# for now to properly filter out inappropriate events. This dependency
diff --git a/udev/95-dm-notify.rules b/udev/95-dm-notify.rules
deleted file mode 100644
index c6bf23b..0000000
--- a/udev/95-dm-notify.rules
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright (C) 2009 Red Hat, Inc. All rights reserved.
-#
-# This file is part of LVM2.
-
-# Udev rules for device-mapper devices.
-#
-# These rules are responsible for sending a notification to a process
-# waiting for completion of udev rules. The process is identified by
-# a cookie value sent within "change" and "remove" events (the cookie
-# value is set before by that process for every action requested).
-
-SUBSYSTEM!="block", GOTO="dm_end"
-KERNEL!="dm-[0-9]*", GOTO="dm_end"
-ACTION!="change|remove", GOTO="dm_end"
-
-ENV{DM_COOKIE}=="?*", RUN+="$env{DM_SBIN_PATH}/dmsetup udevcomplete $env{DM_COOKIE}"
-
-LABEL="dm_end"
diff --git a/udev/Makefile.in b/udev/Makefile.in
index 0a0050a..06d5ecc 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -16,7 +16,7 @@ top_srcdir = @top_srcdir@
top_builddir = @top_builddir@
VPATH = @srcdir@
-DM_RULES=10-dm.rules 13-dm-disk.rules 95-dm-notify.rules
+DM_RULES=10-dm.rules 13-dm-disk.rules
LVM_RULES=11-dm-lvm.rules
DM_DIR=$(shell grep "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | awk '{print $$3}')
--
One does not thank logic.
-- Sarek, "Journey to Babel", stardate 3842.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] udev: move notify rule
2009-10-30 14:51 [PATCH] udev: move notify rule Bastian Blank
@ 2009-10-30 15:54 ` Peter Rajnoha
2009-11-04 11:26 ` Bastian Blank
0 siblings, 1 reply; 4+ messages in thread
From: Peter Rajnoha @ 2009-10-30 15:54 UTC (permalink / raw)
To: lvm-devel
Hi,
On 10/30/2009 03:51 PM, Bastian Blank wrote:
> Move notify rule into the first rules file. The RUN commands is executed
> after everything is finished, so it makes no difference if it is set
> early or late.
>
yes, this is true with respect to all the other udev processing. But the point of having
it as 95-dm.rules is that there could be some other RUN+="..." line in the other rules.
These are processed in sequence of their order of appearance then and we really would
like to send the notification after all this processing is done (considering those
"RUNs" as well)...
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] udev: move notify rule
2009-10-30 15:54 ` Peter Rajnoha
@ 2009-11-04 11:26 ` Bastian Blank
2009-11-04 12:40 ` Peter Rajnoha
0 siblings, 1 reply; 4+ messages in thread
From: Bastian Blank @ 2009-11-04 11:26 UTC (permalink / raw)
To: lvm-devel
On Fri, Oct 30, 2009 at 04:54:56PM +0100, Peter Rajnoha wrote:
> On 10/30/2009 03:51 PM, Bastian Blank wrote:
> > Move notify rule into the first rules file. The RUN commands is executed
> > after everything is finished, so it makes no difference if it is set
> > early or late.
> yes, this is true with respect to all the other udev processing. But the point of having
> it as 95-dm.rules is that there could be some other RUN+="..." line in the other rules.
And there are no constraints about the order of this executions. If you
know more then the udev docu, fix it there.
Bastian
--
Where there's no emotion, there's no motive for violence.
-- Spock, "Dagger of the Mind", stardate 2715.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] udev: move notify rule
2009-11-04 11:26 ` Bastian Blank
@ 2009-11-04 12:40 ` Peter Rajnoha
0 siblings, 0 replies; 4+ messages in thread
From: Peter Rajnoha @ 2009-11-04 12:40 UTC (permalink / raw)
To: lvm-devel
On 11/04/2009 12:26 PM, Bastian Blank wrote:
> On Fri, Oct 30, 2009 at 04:54:56PM +0100, Peter Rajnoha wrote:
>> On 10/30/2009 03:51 PM, Bastian Blank wrote:
>>> Move notify rule into the first rules file. The RUN commands is executed
>>> after everything is finished, so it makes no difference if it is set
>>> early or late.
>> yes, this is true with respect to all the other udev processing. But the point of having
>> it as 95-dm.rules is that there could be some other RUN+="..." line in the other rules.
>
> And there are no constraints about the order of this executions. If you
> know more then the udev docu, fix it there.
OK, maybe I should assure myself with udev guys so we're 100% sure
(it's not so essential now, but it could be in the future - there
are more plans for udev usage with respect to LVM, so I need to be
sure about this ordering, that's true...).
But this is the behaviour I observed when I tested this. But you're
right, I'll make sure...
Peter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-04 12:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-30 14:51 [PATCH] udev: move notify rule Bastian Blank
2009-10-30 15:54 ` Peter Rajnoha
2009-11-04 11:26 ` Bastian Blank
2009-11-04 12:40 ` Peter Rajnoha
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.