Skip to contentSkip to conversation

mtd: don't lock when recursively deleting partitions

PATCH Applied David Bauer 2 participants 2 messages Feb 17, 2021 – Mar 3, 2021 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: don't lock when recursively deleting partitions

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

---
 drivers/mtd/mtdpart.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/mtdpart.c +1 -1
index c3575b686f79..95d47422bbf2 100644
@@ -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);
Signature · 6 lines
2.30.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
maintainer Applied
#1 lore raw
Quoted 7 lines · David Bauer

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

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

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/