Skip to content

Commit 7a670cf

Browse files
jsmart-ghgregkh
authored andcommitted
nvme-fc: avoid race between time out and tear down
[ Upstream commit e5445da ] 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 <jsmart2021@gmail.com> Tested-by: Daniel Wagner <dwagner@suse.de> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent c251d02 commit 7a670cf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/nvme/host

‎drivers/nvme/host/fc.c‎

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

0 commit comments

Comments
 (0)