nvme-loop: check if queue is ready in queue_rq
authorSagi Grimberg <sagi@grimberg.me>
Tue, 24 Oct 2017 12:25:22 +0000 (15:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Feb 2018 16:38:58 +0000 (17:38 +0100)
commit7af5f9137c93bd69384a3d12d9f741b63f4d98c4
treefe6b740d623f55d7f6601400f9c1851bffd5ec76
parentdb2044fc42305d2f8f92f24e16f223b66dff6cfe
nvme-loop: check if queue is ready in queue_rq

[ Upstream commit 9d7fab04b95e8c26014a9bfc1c943b8360b44c17 ]

In case the queue is not LIVE (fully functional and connected at the nvmf
level), we cannot allow any commands other than connect to pass through.

Add a new queue state flag NVME_LOOP_Q_LIVE which is set after nvmf connect
and cleared in queue teardown.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/nvme/target/loop.c