[BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions

Brian Norris computersforpeace at gmail.com
Mon Aug 15 19:13:50 EDT 2011


Hi Artem,

On Sun, Aug 14, 2011 at 9:11 PM, Artem Bityutskiy <dedekind1 at gmail.com> wrote:
> How about: make a quick fix and release mtd-utils-1.4.6, then just kill
> the -a option. I'd vote for eliminating all the code which has to
> guess/assume/find the device node names - I think they always have to be
> passed by the user instead. We can do the elimination the usual way -
> first add the warning, then kill.

Well, I have a little reservation on killing `-a', since it's useful.
In light of this, you just pushed some of my bug reporting
documentation to the website that includes references to `mtdinfo -a',
since it contains a lot more info than `cat /proc/mtd'. But we can
just modify the website again, if necessary.

> This is also a good way to go because mtd stuff does not have enough
> people for excellent maintenance, and keeping it simpler should be
> helpful.

I agree that simpler is better (usually). So if we decide that will be
simplest, then that's fine.

Is there a problem with my choice of option 2 from Mike's list?

> > 2: add a warning --all that it could be incomplete

See my patch that implements it:
http://lists.infradead.org/pipermail/linux-mtd/2011-August/037393.html

This way, we do not rely on guessing any paths; we simply use the
sysfs information that is exposed, among other purposes, for cases
cases like this, right? And then (as I stated on another message in
this thread) we could even support the "region info" on newer kernels,
if somebody ever does the work to export them. I think this solution
involves no extra work right now, does not remove valuable features,
does not make dirty assumptions about node names, and can take
advantage of new sysfs features in the future. The main downside I see
is the potential (documented) difference in information printed by
`mtdinfo --all' vs. `mtdinfo /dev/mtdX'.

Brian



More information about the linux-mtd mailing list