Skip to content

Commit

Permalink
nvme-fcloop: Fix dropped LS's to removed target port
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
James Smart authored and Christoph Hellwig committed Aug 28, 2018
1 parent f1ed3df commit afd299c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/nvme/target/fcloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ fcloop_tgt_lsrqst_done_work(struct work_struct *work)
struct fcloop_tport *tport = tls_req->tport;
struct nvmefc_ls_req *lsreq = tls_req->lsreq;

if (tport->remoteport)
if (!tport || tport->remoteport)
lsreq->done(lsreq, tls_req->status);
}

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

if (!rport->targetport) {
tls_req->status = -ECONNREFUSED;
tls_req->tport = NULL;
schedule_work(&tls_req->work);
return ret;
}
Expand Down

0 comments on commit afd299c

Please sign in to comment.