Re: [PATCH] mtd: mtdpart: ignore error -ENOENT from parsers on subpartitions

From: Miquel Raynal

Date: Wed Nov 12 2025 - 04:33:30 EST


Hi Christian,

On 09/11/2025 at 12:52:44 +01, Christian Marangi <ansuelsmth@xxxxxxxxx> wrote:

> Commit 5c2f7727d437 ("mtd: mtdpart: check for subpartitions parsing
> result") introduced some kind of regression with parser on subpartitions
> where if a parser emits an error then the entire parsing process from the
> upper parser fails and partitions are deleted.
>
> Not checking for error in subpartitions was originally intended as
> special parser can emit error also in the case of the partition not
> correctly init (for example a wiped partition) or special case where the
> partition should be skipped due to some ENV variables externally
> provided (from bootloader for example)
>
> One example case is the TRX partition where, in the context of a wiped
> partition, returns a -ENOENT as the trx_magic is not found in the
> expected TRX header (as the partition is wiped)

I didn't had in mind this was a valid case. I am a bit puzzled because
it opens the breach to other special cases, but at the same time I have
no strong arguments to refuse this situation so let's go for it.

Thanks,
Miquèl