Re: [RFC] mtd: virt-concat: define duplicate partition handling

Pengpeng Hou <[email protected]> Fri, 31 Jul 2026 22:22:33 +0800
Newsgroups org.infradead.lists.linux-mtd,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
Hi Miquel,

I checked the current callers more closely. The only in-tree call site I
found that can invoke mtd_device_parse_register() and then
mtd_device_register() on the same mtd_info is the nr_partitions path in
plat-ram. Its only in-tree producer, pismo, leaves nr_partitions at zero.
I therefore do not have a current in-tree path that reparses the same OF
partition and reaches the duplicate append described in the RFC.

mtd_device_parse_register() also does not hold a global MTD lock across
mtd_virt_concat_node_create(), partition parsing, and
mtd_virt_concat_create_join(); mtd_table_mutex is taken only inside the
individual add/delete helpers. However, the absence of such a lock alone
does not establish a reachable race, and I do not currently have a
reproducer for concurrent component registration.

So the RFC combined an unchecked append with reachability that I had not
established. I will not pursue this version. If I can demonstrate a
concurrent registration path, I will send a focused proposal with that
evidence and keep any serialization inside mtd_virt_concat as you
suggested.

Thanks for the questions.

Pengpeng


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