Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4592023pxj; Wed, 12 May 2021 08:51:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwidvn8R41FnWU0Mna1nZMmTX3/v2p4MB0wz7sXWVesnS/aZ7U3aBku5CeT+sMAftEBAtFK X-Received: by 2002:a17:906:b6c5:: with SMTP id ec5mr38649399ejb.290.1620834667039; Wed, 12 May 2021 08:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834667; cv=none; d=google.com; s=arc-20160816; b=UNCo82wN2Ieo3NjYD7qcc8ZwAyPc29YqYrT/rC2IYoOxbMH9sGavPGHuEMx/GzLaRh s96RIIW5lwCdD2j26j7J27UvcjLphzPhVZUr8ooJDxWu90Ndl4OZHEvb9tcguYFhuQYt jEzHLVbD//69xETH5o8aWE9CGKiuvewS8N5ViFLAj72brxETWl7Bb7EPfj5T9PYmmXqE +8CISDT6wz2fSLpKTQuy6pKxMEmHsodgKL5/ffjE4BTEjKMXQ4iPfxBWto8PKDmEsMja Oa7VB1Dm+sWdPdV4HISNaakT8cVW/xxgSYxARj2OQiQl+eY611CPair4sqe5g9816W0Y X9BQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tuUs4MKYv2MHHIP1k9OJDX4K2rzfupw23P3q0nFfG3o=; b=x0MYJJfeQDWG1216tih0m7NpEfDfBlH+B940EjjL9LrTvsaGTYvDHLvST1olwd8ieX rRDax7kRZM0xvT6GjgxYyQMIT/bY1LU+NUS3wq/WkMOCLFBaXRL4AoE7IsYM+IJ6VZnb RF0dHl/SBKGNlevfi8UZWfo9b0oq2FikYPuUxry8JMdb8PcRhhViUA5CGr2fQ0oYSxZC RJi1vEAnQXHdPRlliC5FflDODc3wmt1pF9ENCXjIHEMBkyeTwKn8K/dDHo/qT9hYICG5 yt/Udoahq4EV6wfgqlL+27SeTI6lyB0J7V/7goi8hgIsk10yvJsDYqNIN0L3MxERh+ks 6gDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eoMUQQ7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z8si50061edb.86.2021.05.12.08.50.43; Wed, 12 May 2021 08:51:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eoMUQQ7P; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236824AbhELPql (ORCPT + 99 others); Wed, 12 May 2021 11:46:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:58726 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233383AbhELPU4 (ORCPT ); Wed, 12 May 2021 11:20:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E89EB61490; Wed, 12 May 2021 15:08:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832124; bh=w8ThypbtQWX26mEdMFWbwl0qLBFoHfiAFNpcf35XHsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eoMUQQ7PNBwUugtc0eJAc44RSnoiAQnXVM+lkSVYNJ+BhYie0RDkPjKD5ltdrXeAx LqrFkYl92Ewm1xKARKQkCJ3FKW4YByZkeMMI1hsjHz4seRA4kKJ5fWdDSTz0l+bMva kOi/M/1WnRJvnnlm5bWd+8SHnQBYtyUlz2MPaAGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, David Bauer , Miquel Raynal , Sasha Levin Subject: [PATCH 5.10 152/530] mtd: dont lock when recursively deleting partitions Date: Wed, 12 May 2021 16:44:22 +0200 Message-Id: <20210512144824.841955924@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: David Bauer [ Upstream commit cb4543054c5c4fd33df960b41d7b483ebca8e786 ] When recursively deleting partitions, don't acquire the masters partition lock twice. Otherwise the process ends up in a deadlocked state. Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling") Signed-off-by: David Bauer Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20210217195320.893253-1-mail@david-bauer.net Signed-off-by: Sasha Levin --- drivers/mtd/mtdpart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index c3575b686f79..95d47422bbf2 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c @@ -331,7 +331,7 @@ static int __del_mtd_partitions(struct mtd_info *mtd) list_for_each_entry_safe(child, next, &mtd->partitions, part.node) { if (mtd_has_partitions(child)) - del_mtd_partitions(child); + __del_mtd_partitions(child); pr_info("Deleting %s MTD partition\n", child->name); ret = del_mtd_device(child); -- 2.30.2