diff options
author | Jianchao Wang | 2018-01-06 01:01:58 +0100 |
---|---|---|
committer | Christoph Hellwig | 2018-01-08 11:02:13 +0100 |
commit | 2b1b7e784a63f5ded4dda804e05e3f34b3880b25 (patch) | |
tree | 011f05d2455d427dfa8e0a2cdff709c19366dcad /drivers/nvme/host/nvme.h | |
parent | nvme: modify the debug level for setting shutdown timeout (diff) | |
download | kernel-qcow2-linux-2b1b7e784a63f5ded4dda804e05e3f34b3880b25.tar.gz kernel-qcow2-linux-2b1b7e784a63f5ded4dda804e05e3f34b3880b25.tar.xz kernel-qcow2-linux-2b1b7e784a63f5ded4dda804e05e3f34b3880b25.zip |
nvme-pci: fix NULL pointer reference in nvme_alloc_ns
When the io queues setup or tagset allocation failed, ctrl.tagset is
NULL. But the scan work will still be queued and executed, then panic
comes up due to NULL pointer reference of ctrl.tagset.
To fix this, add a new ctrl state NVME_CTRL_ADMIN_ONLY to inidcate only
admin queue is live. When non io queues or tagset allocation failed, ctrl
enters into this state, scan work will not be started. But async event
work and nvme dev ioctl will be still available. This will be helpful to
do further investigation and recovery.
Suggested-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/nvme.h')
-rw-r--r-- | drivers/nvme/host/nvme.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/nvme/host/nvme.h b/drivers/nvme/host/nvme.h index ea1aa5283e8e..eecf71ce6e75 100644 --- a/drivers/nvme/host/nvme.h +++ b/drivers/nvme/host/nvme.h @@ -119,6 +119,7 @@ static inline struct nvme_request *nvme_req(struct request *req) enum nvme_ctrl_state { NVME_CTRL_NEW, NVME_CTRL_LIVE, + NVME_CTRL_ADMIN_ONLY, /* Only admin queue live */ NVME_CTRL_RESETTING, NVME_CTRL_RECONNECTING, NVME_CTRL_DELETING, |