aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2016-08-31 15:17:49 -0700
committerWilly Tarreau <w@1wt.eu>2017-02-10 11:04:08 +0100
commitfa88cd790f2d6e1a0c506b1e38fe8e29080a1e53 (patch)
tree1754105694bf2cd1a9585502e429b35f7f80b9ec
parent7fbbad139de7e3de9c88a8bbdd9f5671e2ae69ed (diff)
downloadedison-v3.10-fa88cd790f2d6e1a0c506b1e38fe8e29080a1e53.tar.gz
dm: mark request_queue dead before destroying the DM device
commit 3b785fbcf81c3533772c52b717f77293099498d3 upstream. This avoids that new requests are queued while __dm_destroy() is in progress. [js] use md->queue instead of non-present helper Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Willy Tarreau <w@1wt.eu>
-rw-r--r--drivers/md/dm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index f69fed826a5..a77ef6cac62 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2323,6 +2323,7 @@ EXPORT_SYMBOL_GPL(dm_device_name);
static void __dm_destroy(struct mapped_device *md, bool wait)
{
+ struct request_queue *q = md->queue;
struct dm_table *map;
might_sleep();
@@ -2333,6 +2334,10 @@ static void __dm_destroy(struct mapped_device *md, bool wait)
set_bit(DMF_FREEING, &md->flags);
spin_unlock(&_minor_lock);
+ spin_lock_irq(q->queue_lock);
+ queue_flag_set(QUEUE_FLAG_DYING, q);
+ spin_unlock_irq(q->queue_lock);
+
/*
* Take suspend_lock so that presuspend and postsuspend methods
* do not race with internal suspend.