Skip to content

Commit c57cdf7

Browse files
Ming Leiaxboe
authored andcommitted
block: call rq_qos_exit() after queue is frozen
rq_qos_exit() removes the current q->rq_qos, this action has to be done after queue is frozen, otherwise the IO queue path may never be waken up, then IO hang is caused. So fixes this issue by moving rq_qos_exit() after queue is frozen. Cc: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 698b53b commit c57cdf7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

block/blk-core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,9 @@ void blk_cleanup_queue(struct request_queue *q)
785785
* prevent that q->request_fn() gets invoked after draining finished.
786786
*/
787787
blk_freeze_queue(q);
788+
789+
rq_qos_exit(q);
790+
788791
spin_lock_irq(lock);
789792
queue_flag_set(QUEUE_FLAG_DEAD, q);
790793
spin_unlock_irq(lock);

block/blk-sysfs.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,8 +1007,6 @@ void blk_unregister_queue(struct gendisk *disk)
10071007
kobject_del(&q->kobj);
10081008
blk_trace_remove_sysfs(disk_to_dev(disk));
10091009

1010-
rq_qos_exit(q);
1011-
10121010
mutex_lock(&q->sysfs_lock);
10131011
if (q->request_fn || (q->mq_ops && q->elevator))
10141012
elv_unregister_queue(q);

0 commit comments

Comments
 (0)