diff mbox

Do not process sysfs attributes when device is being destructed

Message ID 4A22EEA4.5010708@redhat.com (mailing list archive)
State Accepted, archived
Delegated to: Alasdair Kergon
Headers show

Commit Message

Milan Broz May 31, 2009, 8:55 p.m. UTC
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(-)



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

Patch

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