Skip to content

Commit 73a5379

Browse files
sagigrimbergChristoph Hellwig
authored andcommitted
nvme-fabrics: allow to queue requests for live queues
Right now we are failing requests based on the controller state (which is checked inline in nvmf_check_ready) however we should definitely accept requests if the queue is live. When entering controller reset, we transition the controller into NVME_CTRL_RESETTING, and then return BLK_STS_RESOURCE for non-mpath requests (have blk_noretry_request set). This is also the case for NVME_REQ_USER for the wrong reason. There shouldn't be any reason for us to reject this I/O in a controller reset. We do want to prevent passthru commands on the admin queue because we need the controller to fully initialize first before we let user passthru admin commands to be issued. In a non-mpath setup, this means that the requests will simply be requeued over and over forever not allowing the q_usage_counter to drop its final reference, causing controller reset to hang if running concurrently with heavy I/O. Fixes: 35897b9 ("nvme-fabrics: fix and refine state checks in __nvmf_check_ready") Reviewed-by: James Smart <james.smart@broadcom.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent ceb1e08 commit 73a5379

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/nvme/host/fabrics.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,10 +565,14 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
565565
struct nvme_request *req = nvme_req(rq);
566566

567567
/*
568-
* If we are in some state of setup or teardown only allow
569-
* internally generated commands.
568+
* currently we have a problem sending passthru commands
569+
* on the admin_q if the controller is not LIVE because we can't
570+
* make sure that they are going out after the admin connect,
571+
* controller enable and/or other commands in the initialization
572+
* sequence. until the controller will be LIVE, fail with
573+
* BLK_STS_RESOURCE so that they will be rescheduled.
570574
*/
571-
if (!blk_rq_is_passthrough(rq) || (req->flags & NVME_REQ_USERCMD))
575+
if (rq->q == ctrl->admin_q && (req->flags & NVME_REQ_USERCMD))
572576
return false;
573577

574578
/*
@@ -577,7 +581,7 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
577581
*/
578582
switch (ctrl->state) {
579583
case NVME_CTRL_CONNECTING:
580-
if (nvme_is_fabrics(req->cmd) &&
584+
if (blk_rq_is_passthrough(rq) && nvme_is_fabrics(req->cmd) &&
581585
req->cmd->fabrics.fctype == nvme_fabrics_type_connect)
582586
return true;
583587
break;

0 commit comments

Comments
 (0)