Skip to content

Commit 950a739

Browse files
hreineckegregkh
authored andcommitted
nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp_rqst()
[ Upstream commit 2a4a910 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 66e8848 commit 950a739

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
@@ -2499,13 +2499,6 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
24992499
u32 xfrlen = be32_to_cpu(cmdiu->data_len);
25002500
int ret;
25012501

2502-
/*
2503-
* if there is no nvmet mapping to the targetport there
2504-
* shouldn't be requests. just terminate them.
2505-
*/
2506-
if (!tgtport->pe)
2507-
goto transport_error;
2508-
25092502
/*
25102503
* Fused commands are currently not supported in the linux
25112504
* implementation.
@@ -2533,7 +2526,8 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
25332526

25342527
fod->req.cmd = &fod->cmdiubuf.sqe;
25352528
fod->req.cqe = &fod->rspiubuf.cqe;
2536-
fod->req.port = tgtport->pe->port;
2529+
if (tgtport->pe)
2530+
fod->req.port = tgtport->pe->port;
25372531

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

0 commit comments

Comments
 (0)