From 7a086776ad581c9b6278d86d927b533e63852259 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 12 Oct 2018 09:24:57 -0600 Subject: [PATCH 0570/2944] block: remove bogus check for queue_lock assignment commit 5e27891e88555fecd8262e110e1a29feca4b0166 upstream. 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: Jens Axboe Signed-off-by: Joseph Qi Reviewed-by: Xiaoguang Wang --- block/blk-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 130709b..359394c 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1060,8 +1060,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id, mutex_init(&q->sysfs_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 -- 1.8.3.1