* [PATCH] nvme: check ctrl.tagset before start ns scan
@ 2018-01-02 18:07 Jianchao Wang
2018-01-03 9:37 ` Sagi Grimberg
0 siblings, 1 reply; 3+ messages in thread
From: Jianchao Wang @ 2018-01-02 18:07 UTC (permalink / raw)
To: keith.busch, axboe, hch, sagi; +Cc: linux-nvme, linux-kernel
ctrl.tagset maybe NULL due to failure of io queue setup or blk-mq
tagset allocation in nvme_reset_work. Then panic would come up.
To fix this, just add ctrl.tagset check in nvme_scan_work.
Signed-off-by: Jianchao Wang <jianchao.w.wang@oracle.com>
---
drivers/nvme/host/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 1e46e60..1ed593d 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -3071,7 +3071,7 @@ static void nvme_scan_work(struct work_struct *work)
struct nvme_id_ctrl *id;
unsigned nn;
- if (ctrl->state != NVME_CTRL_LIVE)
+ if ((ctrl->state != NVME_CTRL_LIVE) || !ctrl->tagset)
return;
if (nvme_identify_ctrl(ctrl, &id))
--
2.7.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: check ctrl.tagset before start ns scan
2018-01-02 18:07 [PATCH] nvme: check ctrl.tagset before start ns scan Jianchao Wang
@ 2018-01-03 9:37 ` Sagi Grimberg
2018-01-04 4:01 ` jianchao.wang
0 siblings, 1 reply; 3+ messages in thread
From: Sagi Grimberg @ 2018-01-03 9:37 UTC (permalink / raw)
To: Jianchao Wang, keith.busch, axboe, hch; +Cc: linux-nvme, linux-kernel
Hi Jianchao,
> ctrl.tagset maybe NULL due to failure of io queue setup or blk-mq
> tagset allocation in nvme_reset_work. Then panic would come up.
> To fix this, just add ctrl.tagset check in nvme_scan_work.
This came up before (and forgotten...) I think we should not
have state indicators other than ctrl->state.
How about instead we add a new state NVME_CTRL_ADMIN_LIVE when we have
no I/O queues.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] nvme: check ctrl.tagset before start ns scan
2018-01-03 9:37 ` Sagi Grimberg
@ 2018-01-04 4:01 ` jianchao.wang
0 siblings, 0 replies; 3+ messages in thread
From: jianchao.wang @ 2018-01-04 4:01 UTC (permalink / raw)
To: Sagi Grimberg, keith.busch, axboe, hch; +Cc: linux-nvme, linux-kernel
Hi sagi
Many thanks for your kindly response.
On 01/03/2018 05:37 PM, Sagi Grimberg wrote:
> Hi Jianchao,
>
>> ctrl.tagset maybe NULL due to failure of io queue setup or blk-mq
>> tagset allocation in nvme_reset_work. Then panic would come up.
>> To fix this, just add ctrl.tagset check in nvme_scan_work.
>
> This came up before (and forgotten...) I think we should not
> have state indicators other than ctrl->state.
>
> How about instead we add a new state NVME_CTRL_ADMIN_LIVE when we have
> no I/O queues.
>
Yes, that's a good idea that add a new state NMVE_CTRL_ADMIN_LIVE to indicate
only the admin queue live. On the other hand, add a sanity checking that whether
ctrl->tagset is NULL is also necessary. :)
Thanks
Jianchao
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-01-04 4:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-02 18:07 [PATCH] nvme: check ctrl.tagset before start ns scan Jianchao Wang
2018-01-03 9:37 ` Sagi Grimberg
2018-01-04 4:01 ` jianchao.wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®