浏览代码

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>
Christoph Hellwig 7 年之前
父节点
当前提交
278ab3799a
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      drivers/nvme/host/fabrics.h

+ 2 - 1
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,
 static inline bool nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,
 		bool queue_live)
 		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 true;
 	return __nvmf_check_ready(ctrl, rq, queue_live);
 	return __nvmf_check_ready(ctrl, rq, queue_live);
 }
 }