Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1141876imm; Wed, 1 Aug 2018 10:53:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdulNSaMZuwKECH+l0RwLROCyG55Kkq3/LCSuMH87RMZiNzzVLHkKvbrwnbRKDK9TfOv5kB X-Received: by 2002:a62:234d:: with SMTP id j74-v6mr4072492pfj.106.1533145988605; Wed, 01 Aug 2018 10:53:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533145988; cv=none; d=google.com; s=arc-20160816; b=H9/1HyoxN6UR+Jr3HUfJaYMTbAEVshfzMreWDe1j9uWkNaYVcQkMKmZsMifNa3TOkv vlRF8JlIEfDbxh7lEAaAf3w1XEXiMREMhrfwlXoqdR6ZTsYzDS4+R6ebvUFMLlZbOhzh JytQyG/bliEOWL8aUJJLBOHqSCZ5Gi1VwpDvrZtYVfBOMu4/sLV1MtR3pkAeqRcr+c6G N1/Fmogpd31n9zK5Kt6QgS7BzR5K5oYoA80CaxaiFRCRJsFWwekRFN9IJDhjrx3tp50Q WOOU+GxlDZr48EKaoY5ZZv69ZuiMN77nygh550LReoI/2B5TZcVDR8zsW+V1I7su9ujk 48sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=9hjE+9O0G3wtWhc2VlVx+3Z4Z1A6F70qihnD7ecly+c=; b=biUf5ynLkqns2TSLnh17xMQZ0PomZkUMbmDp43XyrEAWSD9g1AeFiY6iHFKqWrkqqb PoBI+QH5pcUyiwZc4Ci0eNvVnzw4tGTLSsh8IiMESLtOshauQsFf3xPVrAu3nkxyrLPm i/r6TgzZ9BliaL9UwOWEhJKZPclD2N4hXt1h+xz29AZlumD6jPNF8nczhVqsfosp3Cj5 YdSQoBnH9GnTOlqH9sCNMkXyD75l0O25c0vA+HzXiQPurtgQVFzY7ZpL3Z4LtNUe6jqS l0E/c3xNi12DChfLZA1fjYrhufL6HtKrvsiZ8IrybmuPa2nLmBlmmCnZSbBjNhTWiCzR xTjA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p131-v6si69174pgp.343.2018.08.01.10.52.53; Wed, 01 Aug 2018 10:53:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390586AbeHATi4 (ORCPT + 99 others); Wed, 1 Aug 2018 15:38:56 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49890 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406032AbeHATIl (ORCPT ); Wed, 1 Aug 2018 15:08:41 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 7036B13B5; Wed, 1 Aug 2018 17:15:18 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Filippo Muzzini , Paolo Valente , Jens Axboe , Sasha Levin Subject: [PATCH 4.14 062/246] block, bfq: remove wrong lock in bfq_requests_merged Date: Wed, 1 Aug 2018 18:49:32 +0200 Message-Id: <20180801165014.665650887@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Filippo Muzzini [ 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 Signed-off-by: Paolo Valente Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- block/bfq-iosched.c | 2 -- 1 file changed, 2 deletions(-) --- a/block/bfq-iosched.c +++ b/block/bfq-iosched.c @@ -1678,7 +1678,6 @@ static void bfq_requests_merged(struct r 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 @@ -1702,7 +1701,6 @@ static void bfq_requests_merged(struct r bfq_remove_request(q, next); - spin_unlock_irq(&bfqq->bfqd->lock); end: bfqg_stats_update_io_merged(bfqq_group(bfqq), next->cmd_flags); }