diff options
author | Sagi Grimberg <sagi@grimberg.me> | 2017-03-13 10:10:11 -0400 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-03-13 10:14:23 -0400 |
commit | 0067d4b020ea07a58540acb2c5fcd3364bf326e0 (patch) | |
tree | 9e2e1375e8db4eb35eb7419b33c5f8cde51afefc | |
parent | f5fe1b51905df7cfe4fdfd85c5fb7bc5b71a094f (diff) |
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>
-rw-r--r-- | block/blk-mq-tag.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c index e48bc2c72615..9d97bfc4d465 100644 --- a/block/blk-mq-tag.c +++ b/block/blk-mq-tag.c | |||
@@ -295,6 +295,9 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set) | |||
295 | for (i = 0; i < set->nr_hw_queues; i++) { | 295 | for (i = 0; i < set->nr_hw_queues; i++) { |
296 | struct blk_mq_tags *tags = set->tags[i]; | 296 | struct blk_mq_tags *tags = set->tags[i]; |
297 | 297 | ||
298 | if (!tags) | ||
299 | continue; | ||
300 | |||
298 | for (j = 0; j < tags->nr_tags; j++) { | 301 | for (j = 0; j < tags->nr_tags; j++) { |
299 | if (!tags->static_rqs[j]) | 302 | if (!tags->static_rqs[j]) |
300 | continue; | 303 | continue; |