nvme-fabrics: don't check discovery ioccsz/iorcsz
authorMax Gurtovoy <mgurtovoy@nvidia.com>
Wed, 20 Dec 2023 09:27:45 +0000 (11:27 +0200)
committerKeith Busch <kbusch@kernel.org>
Thu, 21 Dec 2023 17:18:25 +0000 (09:18 -0800)
IOCCSZ and IORCSZ are reserved for discovery controllers. Avoid checking
their values during identify controller phase.

Fixes: 2fcd3ab39826 ("nvme-fabrics: check ioccsz and iorcsz")
Reported-by: Daniel Wagner <dwagner@suse.de>
Tested-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/host/core.c

index 22dae2a26ba493b792a37b292ebd96f44bf89034..d144d1acb09a05ae3fdb824730af4e9819db5c5d 100644 (file)
@@ -3032,14 +3032,14 @@ static int nvme_check_ctrl_fabric_info(struct nvme_ctrl *ctrl, struct nvme_id_ct
                return -EINVAL;
        }
 
-       if (ctrl->ioccsz < 4) {
+       if (!nvme_discovery_ctrl(ctrl) && ctrl->ioccsz < 4) {
                dev_err(ctrl->device,
                        "I/O queue command capsule supported size %d < 4\n",
                        ctrl->ioccsz);
                return -EINVAL;
        }
 
-       if (ctrl->iorcsz < 1) {
+       if (!nvme_discovery_ctrl(ctrl) && ctrl->iorcsz < 1) {
                dev_err(ctrl->device,
                        "I/O queue response capsule supported size %d < 1\n",
                        ctrl->iorcsz);