Skip to content

Commit 404ec31

Browse files
jsmart-ghaxboe
authored andcommitted
nvmet-fc: bring Disconnect into compliance with FC-NVME spec
The FC-NVME spec, when finally approved, modified the disconnect LS such that the only scope available is the association. Rework the Disconnect LS processing to be in accordance with the change. Signed-off-by: Nigel Kirkland <nigel.kirkland@broadcom.com> Signed-off-by: James Smart <jsmart2021@gmail.com> Reviewed-by: Ewan D. Milne <emilne@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 0191e74 commit 404ec31

File tree

1 file changed

+2
-31
lines changed
  • drivers/nvme/target

1 file changed

+2
-31
lines changed

drivers/nvme/target/fc.c

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,10 +1502,8 @@ nvmet_fc_ls_disconnect(struct nvmet_fc_tgtport *tgtport,
15021502
(struct fcnvme_ls_disconnect_rqst *)iod->rqstbuf;
15031503
struct fcnvme_ls_disconnect_acc *acc =
15041504
(struct fcnvme_ls_disconnect_acc *)iod->rspbuf;
1505-
struct nvmet_fc_tgt_queue *queue = NULL;
15061505
struct nvmet_fc_tgt_assoc *assoc;
15071506
int ret = 0;
1508-
bool del_assoc = false;
15091507

15101508
memset(acc, 0, sizeof(*acc));
15111509

@@ -1536,18 +1534,7 @@ nvmet_fc_ls_disconnect(struct nvmet_fc_tgtport *tgtport,
15361534
assoc = nvmet_fc_find_target_assoc(tgtport,
15371535
be64_to_cpu(rqst->associd.association_id));
15381536
iod->assoc = assoc;
1539-
if (assoc) {
1540-
if (rqst->discon_cmd.scope ==
1541-
FCNVME_DISCONN_CONNECTION) {
1542-
queue = nvmet_fc_find_target_queue(tgtport,
1543-
be64_to_cpu(
1544-
rqst->discon_cmd.id));
1545-
if (!queue) {
1546-
nvmet_fc_tgt_a_put(assoc);
1547-
ret = VERR_NO_CONN;
1548-
}
1549-
}
1550-
} else
1537+
if (!assoc)
15511538
ret = VERR_NO_ASSOC;
15521539
}
15531540

@@ -1575,26 +1562,10 @@ nvmet_fc_ls_disconnect(struct nvmet_fc_tgtport *tgtport,
15751562
sizeof(struct fcnvme_ls_disconnect_acc)),
15761563
FCNVME_LS_DISCONNECT);
15771564

1578-
1579-
/* are we to delete a Connection ID (queue) */
1580-
if (queue) {
1581-
int qid = queue->qid;
1582-
1583-
nvmet_fc_delete_target_queue(queue);
1584-
1585-
/* release the get taken by find_target_queue */
1586-
nvmet_fc_tgt_q_put(queue);
1587-
1588-
/* tear association down if io queue terminated */
1589-
if (!qid)
1590-
del_assoc = true;
1591-
}
1592-
15931565
/* release get taken in nvmet_fc_find_target_assoc */
15941566
nvmet_fc_tgt_a_put(iod->assoc);
15951567

1596-
if (del_assoc)
1597-
nvmet_fc_delete_target_assoc(iod->assoc);
1568+
nvmet_fc_delete_target_assoc(iod->assoc);
15981569
}
15991570

16001571

0 commit comments

Comments
 (0)