Skip to content
Commit 2b1b7e78 authored by Jianchao Wang's avatar Jianchao Wang Committed by Christoph Hellwig
Browse files

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: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJianchao Wang <jianchao.w.wang@oracle.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 1a3838d7
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment