[PATCH] mtd: part: Create the master device node when partitioned

Daniel Ehrenberg dehrenberg at google.com
Tue Mar 10 13:00:35 PDT 2015


On Mon, Mar 9, 2015 at 6:53 PM, Brian Norris
<computersforpeace at gmail.com> wrote:
> I kinda like this strategy. If users were flexible enough, I'd like to
> be able to make this the default eventually. But that probably won't
> happen, so we may have to live with this Kconfig forever, in that case.

:( It'd also be nice if we could name things like mtda, mtda0, mtda1,
etc like SCSI. Alas!
>
> BTW, is there any way to tell the difference between a partition and a
> master device, from user space?

Not that I know of.
>
> Also, would we want to address these comments from mtdpart.c?
>
>  * We don't register the master, or expect the caller to have done so,
>  * for reasons of data integrity.
>
>
>         /* NOTE:  we don't arrange MTDs as a tree; it'd be error-prone
>          * to have the same data be in two different partitions.
>          */
>
> First of all, as I mentioned previously, I don't think the argument is
> valid. We can't (and shouldn't have to) protect users from themselves
> here.

Agreed. Anything I should do to address this comment besides deleting it?
>
> Secondly, I think maybe this should be changed if we register both
> master and partition(s). The partition *should* use the master as its
> parent if we register both devices.
>
While I'd like that change, it looks to me like it'd have to be
conditional on the new sysfs variable. The master's sysfs entries
won't be populated otherwise. Or should we build the sysfs node in
either case? What if people are depending on the current sysfs
semantics (not too hard to imagine actually)?

> Side ntoe: that might provide the means for differentiating master and
> partition -- check the device parent in sysfs.
>
> Brian

Yeah, that'd be easy. It'd also be easy to add sysfs properties
describing the partition more.

Thanks,
Dan



More information about the linux-mtd mailing list