diff options
author | Bart Van Assche <bvanassche@acm.org> | 2018-09-26 14:01:08 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-09-26 15:11:29 -0600 |
commit | bdd6316094e0370cd183bc979dd7e322b68dc993 (patch) | |
tree | fb7cfd6f386ca0d86bd0dc3f3ebe8341defa65f9 /block | |
parent | 18c9a6bbe0645a05172a900740b9d2d379d54320 (diff) | |
download | linux-stable-bdd6316094e0370cd183bc979dd7e322b68dc993.tar.gz linux-stable-bdd6316094e0370cd183bc979dd7e322b68dc993.tar.bz2 linux-stable-bdd6316094e0370cd183bc979dd7e322b68dc993.zip |
block: Allow unfreezing of a queue while requests are in progress
A later patch will call blk_freeze_queue_start() followed by
blk_mq_unfreeze_queue() without waiting for q_usage_counter to drop
to zero. Make sure that this doesn't cause a kernel warning to appear
by switching from percpu_ref_reinit() to percpu_ref_resurrect(). The
former namely requires that the refcount it operates on is zero.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Cc: Jianchao Wang <jianchao.w.wang@oracle.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 85a1c1a59c72..96d501e8663c 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -198,7 +198,7 @@ void blk_mq_unfreeze_queue(struct request_queue *q) freeze_depth = atomic_dec_return(&q->mq_freeze_depth); WARN_ON_ONCE(freeze_depth < 0); if (!freeze_depth) { - percpu_ref_reinit(&q->q_usage_counter); + percpu_ref_resurrect(&q->q_usage_counter); wake_up_all(&q->mq_freeze_wq); } } |