summaryrefslogtreecommitdiffstats
path: root/block/blk-core.c
diff options
context:
space:
mode:
authorMing Lei <ming.lei@redhat.com>2022-03-08 06:51:57 +0100
committerJens Axboe <axboe@kernel.dk>2022-03-08 19:40:01 -0700
commitba3e845665fbbb0252336f27200cd5cf288a3573 (patch)
tree04004f708d092b8c41ba675b733c3dd6f1b47dc9 /block/blk-core.c
parentde3d347f7b8a1a997fbc9267454ed6065068b969 (diff)
downloadlinux-ba3e845665fbbb0252336f27200cd5cf288a3573.tar.bz2
block: move q_usage_counter release into blk_queue_release
After blk_cleanup_queue() returns, disk may not be released yet, so probably bio may still be submitted and ->q_usage_counter may be touched, so far this way seems safe, but not good from API's viewpoint. Move the release q_usage_counter into blk_queue_release(). Signed-off-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20220308055200.735835-12-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r--block/blk-core.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 3fa2f08d3750..a97918d107a0 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -342,8 +342,6 @@ void blk_cleanup_queue(struct request_queue *q)
blk_mq_sched_free_rqs(q);
mutex_unlock(&q->sysfs_lock);
- percpu_ref_exit(&q->q_usage_counter);
-
/* @q is and will stay empty, shutdown and put */
blk_put_queue(q);
}