Skip to content

Commit afd299c

Browse files
jsmart-ghChristoph Hellwig
authored andcommitted
nvme-fcloop: Fix dropped LS's to removed target port
When a targetport is removed from the config, fcloop will avoid calling the LS done() routine thinking the targetport is gone. This leaves the initiator reset/reconnect hanging as it waits for a status on the Create_Association LS for the reconnect. Change the filter in the LS callback path. If tport null (set when failed validation before "sending to remote port"), be sure to call done. This was the main bug. But, continue the logic that only calls done if tport was set but there is no remoteport (e.g. case where remoteport has been removed, thus host doesn't expect a completion). Signed-off-by: James Smart <james.smart@broadcom.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent f1ed3df commit afd299c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/nvme/target/fcloop.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ fcloop_tgt_lsrqst_done_work(struct work_struct *work)
311311
struct fcloop_tport *tport = tls_req->tport;
312312
struct nvmefc_ls_req *lsreq = tls_req->lsreq;
313313

314-
if (tport->remoteport)
314+
if (!tport || tport->remoteport)
315315
lsreq->done(lsreq, tls_req->status);
316316
}
317317

@@ -329,6 +329,7 @@ fcloop_ls_req(struct nvme_fc_local_port *localport,
329329

330330
if (!rport->targetport) {
331331
tls_req->status = -ECONNREFUSED;
332+
tls_req->tport = NULL;
332333
schedule_work(&tls_req->work);
333334
return ret;
334335
}

0 commit comments

Comments
 (0)