提交 ec8f896f 编写于 作者: Y yangerkun 提交者: Xie XiuQi

Revert "block: don't drain in-progress dispatch in blk_cleanup_queue()"

hulk inclusion
category: bugfix
bugzilla: 20127
CVE: NA

-------------------------------------------------

This reverts commit cba577a1b9d763f6a02b7800c8b27d293b28a8a4.

Commit fbc2a15e3433 ("blk-mq: move cancel of requeue_work into
blk_mq_release") introduce that blk_mq_kick_requeue_list can be called
after blk_sync_queue in blk_cleanup_queue. And the "quiesce" state can
avoid requeue work reuse the structure has been released in blk_exit_queue.
Signed-off-by: Nyangerkun <yangerkun@huawei.com>
Reviewed-by: Nzhengbin <zhengbin13@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 30bc07bf
......@@ -784,6 +784,18 @@ void blk_cleanup_queue(struct request_queue *q)
queue_flag_set(QUEUE_FLAG_DEAD, q);
spin_unlock_irq(lock);
/*
* make sure all in-progress dispatch are completed because
* blk_freeze_queue() can only complete all requests, and
* dispatch may still be in-progress since we dispatch requests
* from more than one contexts.
*
* We rely on driver to deal with the race in case that queue
* initialization isn't done.
*/
if (q->mq_ops && blk_queue_init_done(q))
blk_mq_quiesce_queue(q);
/* for synchronous bio-based driver finish in-flight integrity i/o */
blk_flush_integrity();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册