Skip to content

Commit a7d1391

Browse files
jsmart-ghChristoph Hellwig
authored andcommitted
nvme-fc: clear q_live at beginning of association teardown
The __nvmf_check_ready() routine used to bounce all filesystem io if the controller state isn't LIVE. However, a later patch changed the logic so that it rejection ends up being based on the Q live check. The FC transport has a slightly different sequence from rdma and tcp for shutting down queues/marking them non-live. FC marks its queue non-live after aborting all ios and waiting for their termination, leaving a rather large window for filesystem io to continue to hit the transport. Unfortunately this resulted in filesystem I/O or applications seeing I/O errors. Change the FC transport to mark the queues non-live at the first sign of teardown for the association (when I/O is initially terminated). Fixes: 73a5379 ("nvme-fabrics: allow to queue requests for live queues") Signed-off-by: James Smart <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Himanshu Madhani <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent a0fdd14 commit a7d1391

File tree

1 file changed

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

1 file changed

+12
-0
lines changed

drivers/nvme/host/fc.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,6 +2461,18 @@ nvme_fc_terminate_exchange(struct request *req, void *data, bool reserved)
24612461
static void
24622462
__nvme_fc_abort_outstanding_ios(struct nvme_fc_ctrl *ctrl, bool start_queues)
24632463
{
2464+
int q;
2465+
2466+
/*
2467+
* if aborting io, the queues are no longer good, mark them
2468+
* all as not live.
2469+
*/
2470+
if (ctrl->ctrl.queue_count > 1) {
2471+
for (q = 1; q < ctrl->ctrl.queue_count; q++)
2472+
clear_bit(NVME_FC_Q_LIVE, &ctrl->queues[q].flags);
2473+
}
2474+
clear_bit(NVME_FC_Q_LIVE, &ctrl->queues[0].flags);
2475+
24642476
/*
24652477
* If io queues are present, stop them and terminate all outstanding
24662478
* ios on them. As FC allocates FC exchange for each io, the

0 commit comments

Comments
 (0)