[PATCH v4] mtd: super: don't rely on mtdblock device minor

Christoph Hellwig hch at lst.de
Tue May 11 09:42:48 PDT 2021


On Tue, May 11, 2021 at 08:57:15AM +0100, Daniel Golle wrote:
> > Why are you changing the legacy lookup method that is clearly deprecated
> > in favor of the mdt* syntax?
> 
> Because it breaks if part_bits != 1 and despite being legacy, it should
> not break (it would open the wrong MTD device).

Or we should just drop it if it doesn't even work.

> I do check the major number above to be MTD_BLOCK_MAJOR, and in that
> case I assume that my expectations towards private structure will hold
> true. If not, please enlighten me.

No, you can't.  There's always the chance some other driver grabs
the major.  Take a look at what e.g. ubd does to grab the IDE major.



More information about the linux-mtd mailing list