summaryrefslogtreecommitdiffstats
path: root/drivers/nvme/host
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-06-11 17:37:23 +0200
committerChristoph Hellwig <hch@lst.de>2018-06-15 11:21:00 +0200
commit278ab3799a2588f97423180947f09ec5b576e79e (patch)
tree1b67f22f34223cd4b197fdbe97bed3d6d97cc0e0 /drivers/nvme/host
parentnvme-fabrics: refactor queue ready check (diff)
downloadlinux-278ab3799a2588f97423180947f09ec5b576e79e.tar.xz
linux-278ab3799a2588f97423180947f09ec5b576e79e.zip
nvme-fabrics: handle the admin-only case properly in nvmf_check_ready
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>
Diffstat (limited to 'drivers/nvme/host')
-rw-r--r--drivers/nvme/host/fabrics.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/fabrics.h b/drivers/nvme/host/fabrics.h
index 2ea949a3868c..e1818a27aa2d 100644
--- a/drivers/nvme/host/fabrics.h
+++ b/drivers/nvme/host/fabrics.h
@@ -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);
}