From patchwork Thu Mar 18 13:58:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 86717 Received: from mx01.colomx.prod.int.phx2.redhat.com (mx3-phx2.redhat.com [209.132.183.24]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2IE0Jdn009499 for ; Thu, 18 Mar 2010 14:00:54 GMT Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx01.colomx.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2IDwrqB028065; Thu, 18 Mar 2010 09:58:53 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2IDwdwp026087 for ; Thu, 18 Mar 2010 09:58:40 -0400 Received: from localhost.localdomain (vpn2-9-191.ams2.redhat.com [10.36.9.191]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2IDwUlC012053; Thu, 18 Mar 2010 09:58:33 -0400 From: Milan Broz To: dm-devel@redhat.com, kay.sievers@vrfy.org Date: Thu, 18 Mar 2010 14:58:14 +0100 Message-Id: <1268920694-10960-3-git-send-email-mbroz@redhat.com> In-Reply-To: <1268920694-10960-1-git-send-email-mbroz@redhat.com> References: <1268920694-10960-1-git-send-email-mbroz@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: Milan Broz Subject: [dm-devel] [PATCH 3/3] Do not send multiple REMOVE events for kobjects. X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Mar 2010 14:00:54 +0000 (UTC) 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)) {