Linux Device Mapper development
 help / color / mirror / Atom feed
From: Milan Broz <mbroz@redhat.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: [PATCH] Do not process sysfs attributes when device is being destructed
Date: Sun, 31 May 2009 22:55:00 +0200	[thread overview]
Message-ID: <4A22EEA4.5010708@redhat.com> (raw)

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 <mbroz@redhat.com>
---
 drivers/md/dm.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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;
 }

                 reply	other threads:[~2009-05-31 20:55 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A22EEA4.5010708@redhat.com \
    --to=mbroz@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox