FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 03-18-2010, 12:58 PM
Milan Broz
 
Default Do not send multiple REMOVE events for kobjects.

If the KOBJ_REMOVE was sent already there is no need
to send it again.

One example is when device-mapper device send explicit REMOVE
event with additional DM environment values (cookie) when mapping
table is being destroyed (device is unusable after that) and
underlying block device sends another REMOVE event unconditionally
in its destructor.

Signed-off-by: Milan Broz <mbroz@redhat.com>
---
lib/kobject_uevent.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index c9d3a3e..c7881bd 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -125,6 +125,15 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
kobject_name(kobj), kobj, __func__);
return 0;
}
+
+ /* skip remove event, if already sent*/
+ if (action == KOBJ_REMOVE && kobj->state_remove_uevent_sent) {
+ pr_debug("kobject: '%s' (%p): %s: ignoring "
+ "already sent remove event!
",
+ kobject_name(kobj), kobj, __func__);
+ return 0;
+ }
+
/* skip the event, if the filter returns zero. */
if (uevent_ops && uevent_ops->filter)
if (!uevent_ops->filter(kset, kobj)) {
--
1.7.0

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 04:05 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org