Skip to content

Commit

Permalink
block: remove bogus check for queue_lock assignment
Browse files Browse the repository at this point in the history
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 <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Oct 14, 2018
1 parent e50b1e3 commit 5e27891
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1054,8 +1054,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
Expand Down

0 comments on commit 5e27891

Please sign in to comment.