diff mbox

[3/3] Do not send multiple REMOVE events for kobjects.

Message ID 1268920694-10960-3-git-send-email-mbroz@redhat.com (mailing list archive)
State Deferred, archived
Headers show

Commit Message

Milan Broz March 18, 2010, 1:58 p.m. UTC
None
diff mbox

Patch

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!\n",
+				 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)) {