Skip to content

Commit

Permalink
nvmet-fc: do not check for invalid target port in nvmet_fc_handle_fcp…
Browse files Browse the repository at this point in the history
…_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>
  • Loading branch information
hreinecke authored and gregkh committed Jul 14, 2021
1 parent 66e8848 commit 950a739
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/nvme/target/fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2499,13 +2499,6 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,
u32 xfrlen = be32_to_cpu(cmdiu->data_len);
int ret;

/*
* if there is no nvmet mapping to the targetport there
* shouldn't be requests. just terminate them.
*/
if (!tgtport->pe)
goto transport_error;

/*
* Fused commands are currently not supported in the linux
* implementation.
Expand Down Expand Up @@ -2533,7 +2526,8 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport,

fod->req.cmd = &fod->cmdiubuf.sqe;
fod->req.cqe = &fod->rspiubuf.cqe;
fod->req.port = tgtport->pe->port;
if (tgtport->pe)
fod->req.port = tgtport->pe->port;

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

0 comments on commit 950a739

Please sign in to comment.