提交 d2cd2548 编写于 作者: J Jens Axboe 提交者: Xie XiuQi

block: remove bogus check for queue_lock assignment

mainline inclusion
from mainline-4.20-rc1
commit 5e27891e88555fecd8262e110e1a29feca4b0166
category: bugfix
bugzilla: 9606
CVE: NA
---------------------------

We just allocated the queue and haven't even set it up yet,
hence we know that checking if ->mq_ops is NULL is always
going to be true.

In fact we do need to assign a lock to ->queue_lock always,
as we need it for the queue flags modifications.
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NYufen Yu <yuyufen@huawei.com>
Reviewed-by: NMiao Xie <miaoxie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 8f96f9b9
...@@ -1053,8 +1053,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, ...@@ -1053,8 +1053,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id,
mutex_init(&q->sysfs_lock); mutex_init(&q->sysfs_lock);
spin_lock_init(&q->__queue_lock); spin_lock_init(&q->__queue_lock);
if (!q->mq_ops) q->queue_lock = lock ? : &q->__queue_lock;
q->queue_lock = lock ? : &q->__queue_lock;
/* /*
* A queue starts its life with bypass turned on to avoid * A queue starts its life with bypass turned on to avoid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册