]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
block, bfq: remove wrong lock in bfq_requests_merged
authorFilippo Muzzini <filippo.muzzini@outlook.it>
Thu, 31 May 2018 13:23:11 +0000 (15:23 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:33 +0000 (14:20 +0100)
BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit a12bffebc0c9d6a5851f062aaea3aa7c4adc6042 ]

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: Filippo Muzzini <filippo.muzzini@outlook.it>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
block/bfq-iosched.c

index 6ea998c50bb37c1a7ed8b41187876acd28a1c9ea..df8829c3d36b96fe51819f93ebbac8a31a525f48 100644 (file)
@@ -1721,7 +1721,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq,
 
        if (!RB_EMPTY_NODE(&rq->rb_node))
                goto end;
-       spin_lock_irq(&bfqq->bfqd->lock);
 
        /*
         * If next and rq belong to the same bfq_queue and next is older
@@ -1746,7 +1745,6 @@ static void bfq_requests_merged(struct request_queue *q, struct request *rq,
        bfq_remove_request(q, next);
        bfqg_stats_update_io_remove(bfqq_group(bfqq), next->cmd_flags);
 
-       spin_unlock_irq(&bfqq->bfqd->lock);
 end:
        bfqg_stats_update_io_merged(bfqq_group(bfqq), next->cmd_flags);
 }