]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
block: wake up all tasks blocked in get_request()
authorMing Lei <ming.lei@redhat.com>
Thu, 16 Nov 2017 00:08:44 +0000 (08:08 +0800)
committerJens Axboe <axboe@kernel.dk>
Thu, 16 Nov 2017 04:51:03 +0000 (21:51 -0700)
Once blk_set_queue_dying() is done in blk_cleanup_queue(), we call
blk_freeze_queue() and wait for q->q_usage_counter becoming zero. But
if there are tasks blocked in get_request(), q->q_usage_counter can
never become zero. So we have to wake up all these tasks in
blk_set_queue_dying() first.

Fixes: 3ef28e83ab157997 ("block: generic request_queue reference counting")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-core.c

index 7c54c195e79e87ffc03d5ae1e12d38367e11d1f2..1038706edd87f3e142e6023da1c3a130bfaf1330 100644 (file)
@@ -637,8 +637,8 @@ void blk_set_queue_dying(struct request_queue *q)
                spin_lock_irq(q->queue_lock);
                blk_queue_for_each_rl(rl, q) {
                        if (rl->rq_pool) {
-                               wake_up(&rl->wait[BLK_RW_SYNC]);
-                               wake_up(&rl->wait[BLK_RW_ASYNC]);
+                               wake_up_all(&rl->wait[BLK_RW_SYNC]);
+                               wake_up_all(&rl->wait[BLK_RW_ASYNC]);
                        }
                }
                spin_unlock_irq(q->queue_lock);