From: Guan Junxiong Date: Tue, 13 Jun 2017 02:51:24 +0000 (+0800) Subject: nvmf: keep track of nvmet connect error status X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=97ddc36e4e993bba308aa3e3f58f6de9d5683e95;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git nvmf: keep track of nvmet connect error status To let the host know what happends to the connection establishment, adjust the behavior of nvmf_log_connect_error to make more connect specifig error codes human-readble. Signed-off-by: Guan Junxiong Reviewed-by: Sagi Grimberg Signed-off-by: Christoph Hellwig --- diff --git a/drivers/nvme/host/fabrics.c b/drivers/nvme/host/fabrics.c index 4ed144783079..6e6864516ce6 100644 --- a/drivers/nvme/host/fabrics.c +++ b/drivers/nvme/host/fabrics.c @@ -337,6 +337,24 @@ static void nvmf_log_connect_error(struct nvme_ctrl *ctrl, } } break; + + case NVME_SC_CONNECT_INVALID_HOST: + dev_err(ctrl->device, + "Connect for subsystem %s is not allowed, hostnqn: %s\n", + data->subsysnqn, data->hostnqn); + break; + + case NVME_SC_CONNECT_CTRL_BUSY: + dev_err(ctrl->device, + "Connect command failed: controller is busy or not available\n"); + break; + + case NVME_SC_CONNECT_FORMAT: + dev_err(ctrl->device, + "Connect incompatible format: %d", + cmd->connect.recfmt); + break; + default: dev_err(ctrl->device, "Connect command failed, error wo/DNR bit: %d\n",