Skip to content

Commit ba0718a

Browse files
author
Christoph Hellwig
committed
nvme: don't call blk_mq_{,un}quiesce_tagset when ctrl->tagset is NULL
The NVMe drivers support a mode where no tagset is allocated for the I/O queues and only the admin queue is usable. In that case ctrl->tagset is NULL and we must not call the block per-tagset quiesce helpers that dereference it. Fixes: 98d81f0 ("nvme: use blk_mq_[un]quiesce_tagset") Reported-by: Gerd Bayer <[email protected]> Reported-by: Chao Leng <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Reviewed-by: Chao Leng <[email protected]>
1 parent eea3e8b commit ba0718a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5215,6 +5215,8 @@ EXPORT_SYMBOL_GPL(nvme_start_freeze);
52155215

52165216
void nvme_quiesce_io_queues(struct nvme_ctrl *ctrl)
52175217
{
5218+
if (!ctrl->tagset)
5219+
return;
52185220
if (!test_and_set_bit(NVME_CTRL_STOPPED, &ctrl->flags))
52195221
blk_mq_quiesce_tagset(ctrl->tagset);
52205222
else
@@ -5224,6 +5226,8 @@ EXPORT_SYMBOL_GPL(nvme_quiesce_io_queues);
52245226

52255227
void nvme_unquiesce_io_queues(struct nvme_ctrl *ctrl)
52265228
{
5229+
if (!ctrl->tagset)
5230+
return;
52275231
if (test_and_clear_bit(NVME_CTRL_STOPPED, &ctrl->flags))
52285232
blk_mq_unquiesce_tagset(ctrl->tagset);
52295233
}

0 commit comments

Comments
 (0)