diff options
author | Guan Junxiong <guanjunxiong@huawei.com> | 2017-08-04 12:27:47 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-08-28 22:38:20 +0300 |
commit | 130c24b5be80512be973e3a614abda75f5896b42 (patch) | |
tree | 7d9650b58e3aa5a702c39db123422356471eeb67 /drivers/nvme | |
parent | 1645d5036f9201bd0925aff099fa92fbe7afaff4 (diff) | |
download | linux-130c24b5be80512be973e3a614abda75f5896b42.tar.xz |
nvmet: fix the return error code of target if host is not allowed
nvmf target shall return NVME_SC_CONNECT_INVALID_HOST instead of
the gereal code INVALID_PARAM when the given host nqn is not allowed
to connect. Refer to the 2.2.1 section of the NVMe over Fabrics Spec.
Signed-off-by: Guan Junxiong <guanjunxiong@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/target/core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c index f4b02bb4a1a8..ea7eb00dcb87 100644 --- a/drivers/nvme/target/core.c +++ b/drivers/nvme/target/core.c @@ -749,6 +749,7 @@ u16 nvmet_alloc_ctrl(const char *subsysnqn, const char *hostnqn, hostnqn, subsysnqn); req->rsp->result.u32 = IPO_IATTR_CONNECT_DATA(hostnqn); up_read(&nvmet_config_sem); + status = NVME_SC_CONNECT_INVALID_HOST | NVME_SC_DNR; goto out_put_subsystem; } up_read(&nvmet_config_sem); |