aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-06-22 10:12:11 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2009-07-02 16:32:10 -0700
commit9fad9f263a7065be94bf77519346d0d854ff3b92 (patch)
tree1aabe86a3a1ed83fbf088337dada75a41c54b0c6
parentc3597e89c932b70d10803954d004e36e5f623f24 (diff)
dm: sysfs skip output when device is being destroyed
commit 4d89b7b4e4726893453d0fb4ddbb5b3e16353994 upstream. Do not process sysfs attributes when device is being destroyed. Otherwise code can cause BUG_ON(test_bit(DMF_FREEING, &md->flags)); in dm_put() call. Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/md/dm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index ace998ce59f..925efafa6a5 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -265,6 +265,10 @@ static int dm_blk_open(struct inode *inode, struct file *file)
goto out;
}
+ if (test_bit(DMF_FREEING, &md->flags) ||
+ test_bit(DMF_DELETING, &md->flags))
+ return NULL;
+
dm_get(md);
atomic_inc(&md->open_count);