浏览代码

blk-mq: Fix tagset reinit in the presence of cpu hot-unplug

In case cpu was unplugged, we need to make sure not to assume
that the tags for that cpu are still allocated. so check
for null tags when reinitializing a tagset.

Reported-by: Yi Zhang <yizhan@redhat.com>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Jens Axboe <axboe@fb.com>
Sagi Grimberg 8 年之前
父节点
当前提交
0067d4b020
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      block/blk-mq-tag.c

+ 3 - 0
block/blk-mq-tag.c

@@ -295,6 +295,9 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set)
 	for (i = 0; i < set->nr_hw_queues; i++) {
 	for (i = 0; i < set->nr_hw_queues; i++) {
 		struct blk_mq_tags *tags = set->tags[i];
 		struct blk_mq_tags *tags = set->tags[i];
 
 
+		if (!tags)
+			continue;
+
 		for (j = 0; j < tags->nr_tags; j++) {
 		for (j = 0; j < tags->nr_tags; j++) {
 			if (!tags->static_rqs[j])
 			if (!tags->static_rqs[j])
 				continue;
 				continue;