Skip to content

Commit e5445da

Browse files
jsmart-ghChristoph Hellwig
authored andcommitted
nvme-fc: avoid race between time out and tear down
To avoid race between time out and tear down, in tear down process, first we quiesce the queue, and then delete the timer and cancel the time out work for the queue. This patch merges the admin and io sync ops into the queue teardown logic as shown in the RDMA patch 3017013 "nvme-rdma: avoid race between time out and tear down". There is no teardown_lock in nvme-fc. Signed-off-by: James Smart <[email protected]> Tested-by: Daniel Wagner <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: Daniel Wagner <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 555f66d commit e5445da

File tree

1 file changed

+2
-0
lines changed
  • drivers/nvme/host

1 file changed

+2
-0
lines changed

drivers/nvme/host/fc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2487,6 +2487,7 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
24872487
*/
24882488
if (ctrl->ctrl.queue_count > 1) {
24892489
nvme_stop_queues(&ctrl->ctrl);
2490+
nvme_sync_io_queues(&ctrl->ctrl);
24902491
blk_mq_tagset_busy_iter(&ctrl->tag_set,
24912492
nvme_fc_terminate_exchange, &ctrl->ctrl);
24922493
blk_mq_tagset_wait_completed_request(&ctrl->tag_set);
@@ -2510,6 +2511,7 @@ __nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
25102511
* clean up the admin queue. Same thing as above.
25112512
*/
25122513
blk_mq_quiesce_queue(ctrl->ctrl.admin_q);
2514+
blk_sync_queue(ctrl->ctrl.admin_q);
25132515
blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
25142516
nvme_fc_terminate_exchange, &ctrl->ctrl);
25152517
blk_mq_tagset_wait_completed_request(&ctrl->admin_tag_set);

0 commit comments

Comments
 (0)