diff options
author | Hannes Reinecke <hare@suse.de> | 2021-05-25 15:54:14 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-06-17 16:51:19 +0300 |
commit | 2a4a910aa4f0acc428dc8d10227c42e14ed21d10 (patch) | |
tree | edba6f6d472ffd2b5103e9065d1fdf9256de3ef5 /drivers/nvme/target/fc.c | |
parent | eff4423ec0b03fedb8b7b420549ed8e424d246f1 (diff) | |
download | linux-2a4a910aa4f0acc428dc8d10227c42e14ed21d10.tar.xz |
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>
Diffstat (limited to 'drivers/nvme/target/fc.c')
-rw-r--r-- | drivers/nvme/target/fc.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c index 19e113240fff..22b5108168a6 100644 --- a/drivers/nvme/target/fc.c +++ b/drivers/nvme/target/fc.c @@ -2511,13 +2511,6 @@ nvmet_fc_handle_fcp_rqst(struct nvmet_fc_tgtport *tgtport, 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. * @@ -2544,7 +2537,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)); |