Commit a12bffeb authored by Filippo Muzzini's avatar Filippo Muzzini Committed by Jens Axboe

block, bfq: remove wrong lock in bfq_requests_merged

In bfq_requests_merged(), there is a deadlock because the lock on
bfqq->bfqd->lock is held by the calling function, but the code of
this function tries to grab the lock again.

This deadlock is currently hidden by another bug (fixed by next commit
for this source file), which causes the body of bfq_requests_merged()
to be never executed.

This commit removes the deadlock by removing the lock/unlock pair.
Signed-off-by: default avatarFilippo Muzzini <filippo.muzzini@outlook.it>
Signed-off-by: default avatarPaolo Valente <paolo.valente@linaro.org>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 04c4950d
...@@ -1847,7 +1847,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq, ...@@ -1847,7 +1847,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq,
if (!RB_EMPTY_NODE(&rq->rb_node)) if (!RB_EMPTY_NODE(&rq->rb_node))
goto end; goto end;
spin_lock_irq(&bfqq->bfqd->lock);
/* /*
* If next and rq belong to the same bfq_queue and next is older * If next and rq belong to the same bfq_queue and next is older
...@@ -1872,7 +1871,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq, ...@@ -1872,7 +1871,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq,
bfq_remove_request(q, next); bfq_remove_request(q, next);
bfqg_stats_update_io_remove(bfqq_group(bfqq), next->cmd_flags); bfqg_stats_update_io_remove(bfqq_group(bfqq), next->cmd_flags);
spin_unlock_irq(&bfqq->bfqd->lock);
end: end:
bfqg_stats_update_io_merged(bfqq_group(bfqq), next->cmd_flags); bfqg_stats_update_io_merged(bfqq_group(bfqq), next->cmd_flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment