diff mbox series

mtd: don't lock when recursively deleting partitions

Message ID 20210217195320.893253-1-mail@david-bauer.net
State Accepted
Headers show
Series mtd: don't lock when recursively deleting partitions | expand

Commit Message

David Bauer Feb. 17, 2021, 7:53 p.m. UTC
When recursively deleting partitions, don't acquire the masters
partition lock twice. Otherwise the process ends up in a deadlocked
state.

Fixes commit 46b5889cc2c5 ("mtd: implement proper partition handling")

Signed-off-by: David Bauer <mail@david-bauer.net>
---
 drivers/mtd/mtdpart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Miquel Raynal March 2, 2021, 5:14 p.m. UTC | #1
On Wed, 2021-02-17 at 19:53:20 UTC, David Bauer wrote:
> When recursively deleting partitions, don't acquire the masters
> partition lock twice. Otherwise the process ends up in a deadlocked
> state.
> 
> Fixes commit 46b5889cc2c5 ("mtd: implement proper partition handling")
> 
> Signed-off-by: David Bauer <mail@david-bauer.net>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel
diff mbox series

Patch

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);