From: Guixin Liu Date: Wed, 28 Feb 2024 02:37:59 +0000 (+0800) Subject: nvme-fabrics: check max outstanding commands X-Git-Tag: for-6.9/block-20240310~3^2~22 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=4999568184e5d68903e6d0e49609979cd6ef01d7;p=linux-2.6-block.git nvme-fabrics: check max outstanding commands Maxcmd is mandatory for fabrics, check it early to identify the root cause instead of waiting for it to propagate to "sqsize" and "allocing queue". By the way, change nvme_check_ctrl_fabric_info() to nvmf_validate_identify_ctrl(). Reviewed-by: Chaitanya Kulkarni Signed-off-by: Guixin Liu Signed-off-by: Keith Busch --- diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index eed3e22e24d9..cb13f7c79eaf 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -3119,6 +3119,11 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct return -EINVAL; } + if (!ctrl->maxcmd) { + dev_err(ctrl->device, "Maximum outstanding commands is 0\n"); + return -EINVAL; + } + return 0; }