* [PATCH] blk-mq: Fix tagset reinit in the presence of cpu hot-unplug
@ 2017-03-13 14:10 Sagi Grimberg
2017-03-13 14:23 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Sagi Grimberg @ 2017-03-13 14:10 UTC (permalink / raw)
To: Jens Axboe; +Cc: linux-block, linux-nvme
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>
---
block/blk-mq-tag.c | 3 +++
1 file changed, 3 insertions(+)
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)
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->static_rqs[j])
continue;
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] blk-mq: Fix tagset reinit in the presence of cpu hot-unplug
2017-03-13 14:10 [PATCH] blk-mq: Fix tagset reinit in the presence of cpu hot-unplug Sagi Grimberg
@ 2017-03-13 14:23 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2017-03-13 14:23 UTC (permalink / raw)
To: Sagi Grimberg; +Cc: linux-block, linux-nvme
On 03/13/2017 08:10 AM, Sagi Grimberg wrote:
> 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.
Thanks Sagi, that seems reasonable. Applied for 4.11.
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-13 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13 14:10 [PATCH] blk-mq: Fix tagset reinit in the presence of cpu hot-unplug Sagi Grimberg
2017-03-13 14:23 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).