diff options
author | Milan Broz <mbroz@redhat.com> | 2009-06-22 10:12:11 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-02 16:40:59 -0700 |
commit | 57b70321247d5decb480a8344c29ab5813901790 (patch) | |
tree | 67b62909056407b9b0f12ed894520509f82ef0b3 | |
parent | 85e05eaba5840385843fe61d8db191be84fe3ac6 (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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 8d40f27cce89..377bb6e13e9d 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1728,6 +1728,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; } |