summaryrefslogtreecommitdiff
path: root/drivers/md/dm.c
diff options
context:
space:
mode:
authorAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-27 13:37:40 -0300
committerAndré Fabian Silva Delgado <emulatorman@parabola.nu>2015-10-27 13:37:40 -0300
commitbadc0e42604c4465facd81d2323e98b3b1eb9188 (patch)
treee61811e7ddf70517f4b546d522ba3b630b38f50f /drivers/md/dm.c
parentf19866e5cb04f8f007cb422132ea4611cdacc8e3 (diff)
Linux-libre 4.2.4-gnupck-4.2.4-gnu
Diffstat (limited to 'drivers/md/dm.c')
-rw-r--r--drivers/md/dm.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 0d7ab20c5..3e32f4e31 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2952,8 +2952,6 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
might_sleep();
- map = dm_get_live_table(md, &srcu_idx);
-
spin_lock(&_minor_lock);
idr_replace(&_minor_idr, MINOR_ALLOCED, MINOR(disk_devt(dm_disk(md))));
set_bit(DMF_FREEING, &md->flags);
@@ -2967,14 +2965,14 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
* do not race with internal suspend.
*/
mutex_lock(&md->suspend_lock);
+ map = dm_get_live_table(md, &srcu_idx);
if (!dm_suspended_md(md)) {
dm_table_presuspend_targets(map);
dm_table_postsuspend_targets(map);
}
- mutex_unlock(&md->suspend_lock);
-
/* dm_put_live_table must be before msleep, otherwise deadlock is possible */
dm_put_live_table(md, srcu_idx);
+ mutex_unlock(&md->suspend_lock);
/*
* Rare, but there may be I/O requests still going to complete,