From patchwork Sun May 31 20:55:00 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milan Broz X-Patchwork-Id: 27137 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4VKt4jJ013231 for ; Sun, 31 May 2009 20:55:05 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id 56BEB61A88D; Sun, 31 May 2009 16:55:04 -0400 (EDT) Received: from int-mx2.corp.redhat.com ([172.16.27.26]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n4VKt21D000927 for ; Sun, 31 May 2009 16:55:02 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n4VKt1rT001794 for ; Sun, 31 May 2009 16:55:01 -0400 Received: from [10.32.10.47] (vpn-10-47.str.redhat.com [10.32.10.47]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n4VKt0W1008622 for ; Sun, 31 May 2009 16:55:00 -0400 Message-ID: <4A22EEA4.5010708@redhat.com> Date: Sun, 31 May 2009 22:55:00 +0200 From: Milan Broz User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: device-mapper development X-Enigmail-Version: 0.95.7 X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-loop: dm-devel@redhat.com Subject: [dm-devel] [PATCH] Do not process sysfs attributes when device is being destructed X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com Do not process sysfs attributes when device is being destructed. Otherwise code can cause BUG_ON(test_bit(DMF_FREEING, &md->flags)); in dm_put() call. Signed-off-by: Milan Broz --- drivers/md/dm.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) -- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel diff --git a/drivers/md/dm.c b/drivers/md/dm.c index f43b099..9d3595b 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1806,6 +1806,10 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj) if (&md->kobj != kobj) return NULL; + if (test_bit(DMF_FREEING, &md->flags) || + test_bit(DMF_DELETING, &md->flags)) + return NULL; + dm_get(md); return md; }