nvme-fabrics: handle the admin-only case properly in nvmf_check_ready
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Jun 2018 15:37:23 +0000 (17:37 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 15 Jun 2018 09:21:00 +0000 (11:21 +0200)
In the ADMIN_ONLY state we don't have any I/O queues, but we should accept
all admin commands without further checks.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: James Smart <james.smart@broadcom.com>

drivers/nvme/host/fabrics.h

index 2ea949a..e1818a2 100644 (file)
@@ -169,7 +169,8 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
 static inline bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
                bool queue_live)
 {
-       if (likely(ctrl->state == NVME_CTRL_LIVE))
+       if (likely(ctrl->state == NVME_CTRL_LIVE ||
+                  ctrl->state == NVME_CTRL_ADMIN_ONLY))
                return true;
        return __nvmf_check_ready(ctrl, rq, queue_live);
 }