Message ID | 20160212162435.1e809790@tom-T450 (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Fri, Feb 12, 2016 at 04:24:35PM +0800, Ming Lei wrote: > On Fri, 12 Feb 2016 00:41:28 -0500 > Hi Sasha, > > It should be about timing of setting q->mq_ops, and > I believe the following patch may fix the issue, could > you give a test? Thanks, Ming, that looks better and looks like the same as the 0-day failure from when this was posted a couple months ago. I thought this was potentially risky looking, but haven't had time to make changes. I also didn't see that this was applied yet either. I've a broken filter moving important emails to the junk... On the plus side, the exposure led to a potential fix. -- To unsubscribe from this list: send the line "unsubscribe linux-block" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/block/blk-mq.c b/block/blk-mq.c index 645eb9e..f539a53 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2010,6 +2010,9 @@ static void blk_mq_realloc_hw_ctxs(struct blk_mq_tag_set *set, struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, struct request_queue *q) { + /* mark the queue as mq asap */ + q->mq_ops = set->ops; + q->queue_ctx = alloc_percpu(struct blk_mq_ctx); if (!q->queue_ctx) return ERR_PTR(-ENOMEM); @@ -2032,7 +2035,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, q->nr_queues = nr_cpu_ids; - q->mq_ops = set->ops; q->queue_flags |= QUEUE_FLAG_MQ_DEFAULT; if (!(set->flags & BLK_MQ_F_SG_MERGE))