Skip to content

Commit 2a4a910

Browse files
hreineckeChristoph Hellwig
authored andcommitted
nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp_rqst()
When parsing a request in nvmet_fc_handle_fcp_rqst() we should not check for invalid target ports; if we do the command is aborted from the fcp layer, causing the host to assume a transport error. Rather we should still forward this request to the nvmet layer, which will then correctly fail the command with an appropriate error status. Signed-off-by: Hannes Reinecke <hare@suse.de> Reviewed-by: James Smart <jsmart2021@gmail.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent eff4423 commit 2a4a910

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

  • drivers/nvme/target

‎drivers/nvme/target/fc.c‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,13 +2510,6 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
25102510
u32 xfrlen = be32_to_cpu(cmdiu->data_len);
25112511
int ret;
25122512

2513-
/*
2514-
* if there is no nvmet mapping to the targetport there
2515-
* shouldn't be requests. just terminate them.
2516-
*/
2517-
if (!tgtport->pe)
2518-
goto transport_error;
2519-
25202513
/*
25212514
* Fused commands are currently not supported in the linux
25222515
* implementation.
@@ -2544,7 +2537,8 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
25442537

25452538
fod->req.cmd = &fod->cmdiubuf.sqe;
25462539
fod->req.cqe = &fod->rspiubuf.cqe;
2547-
fod->req.port = tgtport->pe->port;
2540+
if (tgtport->pe)
2541+
fod->req.port = tgtport->pe->port;
25482542

25492543
/* clear any response payload */
25502544
memset(&fod->rspiubuf, 0, sizeof(fod->rspiubuf));

0 commit comments

Comments
 (0)