|
@@ -1797,6 +1797,11 @@ static void blk_mq_map_swqueue(struct request_queue *q,
|
|
|
struct blk_mq_ctx *ctx;
|
|
|
struct blk_mq_tag_set *set = q->tag_set;
|
|
|
|
|
|
+ /*
|
|
|
+ * Avoid others reading imcomplete hctx->cpumask through sysfs
|
|
|
+ */
|
|
|
+ mutex_lock(&q->sysfs_lock);
|
|
|
+
|
|
|
queue_for_each_hw_ctx(q, hctx, i) {
|
|
|
cpumask_clear(hctx->cpumask);
|
|
|
hctx->nr_ctx = 0;
|
|
@@ -1816,6 +1821,8 @@ static void blk_mq_map_swqueue(struct request_queue *q,
|
|
|
hctx->ctxs[hctx->nr_ctx++] = ctx;
|
|
|
}
|
|
|
|
|
|
+ mutex_unlock(&q->sysfs_lock);
|
|
|
+
|
|
|
queue_for_each_hw_ctx(q, hctx, i) {
|
|
|
struct blk_mq_ctxmap *map = &hctx->ctx_map;
|
|
|
|