This patch makes it safe to access the queue usage counter from inside blk_mq_run_hw_queues(). Other than deferring q_usage_counter freeing, this patch does not change any functionality.
Cc: Christoph Hellwig hch@infradead.org Cc: Hannes Reinecke hare@suse.com Cc: James Smart james.smart@broadcom.com Cc: Ming Lei ming.lei@redhat.com Cc: Jianchao Wang jianchao.w.wang@oracle.com Cc: Dongli Zhang dongli.zhang@oracle.com Cc: stable@vger.kernel.org Signed-off-by: Bart Van Assche bvanassche@acm.org --- block/blk-core.c | 2 -- block/blk-sysfs.c | 1 + 2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c index 4673ebe42255..fdcf6de2243f 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -377,8 +377,6 @@ void blk_cleanup_queue(struct request_queue *q) if (queue_is_mq(q)) blk_mq_free_queue(q);
- percpu_ref_exit(&q->q_usage_counter); - /* @q is and will stay empty, shutdown and put */ blk_put_queue(q); } diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 422327089e0f..b8b3d69cd0a5 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c @@ -870,6 +870,7 @@ static void __blk_release_queue(struct work_struct *work)
bioset_exit(&q->bio_split);
+ percpu_ref_exit(&q->q_usage_counter); ida_simple_remove(&blk_queue_ida, q->id); call_rcu(&q->rcu_head, blk_free_queue_rcu); }
linux-stable-mirror@lists.linaro.org