Skip to content

Commit

Permalink
blk-mq: Fix tagset reinit in the presence of cpu hot-unplug
Browse files Browse the repository at this point in the history
[ Upstream commit 0067d4b ]

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 <[email protected]>
Signed-off-by: Sagi Grimberg <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
sagigrimberg authored and gregkh committed Dec 20, 2017
1 parent 143d13d commit d28046f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/blk-mq-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,9 @@ int blk_mq_reinit_tagset(struct blk_mq_tag_set *set)
for (i = 0; i < set->nr_hw_queues; i++) {
struct blk_mq_tags *tags = set->tags[i];

if (!tags)
continue;

for (j = 0; j < tags->nr_tags; j++) {
if (!tags->rqs[j])
continue;
Expand Down

0 comments on commit d28046f

Please sign in to comment.