diff options
author | Keith Busch <keith.busch@intel.com> | 2017-02-10 18:15:51 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-02-22 15:34:00 -0500 |
commit | f33447b90e96076483525b21cc4e0a8977cdd07c (patch) | |
tree | 74e19e4239a9e1b3191ea3693c17aaddc4f03c42 | |
parent | 6db28eda266052f86a6b402422de61eeb7d2e351 (diff) |
nvme/core: Fix race kicking freed request_queue
If a namespace has already been marked dead, we don't want to kick the
request_queue again since we may have just freed it from another thread.
Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r-- | drivers/nvme/host/core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 849e85847ad4..25ec4e585220 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c | |||
@@ -2333,9 +2333,9 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl) | |||
2333 | * Revalidating a dead namespace sets capacity to 0. This will | 2333 | * Revalidating a dead namespace sets capacity to 0. This will |
2334 | * end buffered writers dirtying pages that can't be synced. | 2334 | * end buffered writers dirtying pages that can't be synced. |
2335 | */ | 2335 | */ |
2336 | if (ns->disk && !test_and_set_bit(NVME_NS_DEAD, &ns->flags)) | 2336 | if (!ns->disk || test_and_set_bit(NVME_NS_DEAD, &ns->flags)) |
2337 | revalidate_disk(ns->disk); | 2337 | continue; |
2338 | 2338 | revalidate_disk(ns->disk); | |
2339 | blk_set_queue_dying(ns->queue); | 2339 | blk_set_queue_dying(ns->queue); |
2340 | blk_mq_abort_requeue_list(ns->queue); | 2340 | blk_mq_abort_requeue_list(ns->queue); |
2341 | blk_mq_start_stopped_hw_queues(ns->queue, true); | 2341 | blk_mq_start_stopped_hw_queues(ns->queue, true); |