[PATCH] mkfs.ubifs: remove the check for UBIFS_MAX_LEB_SZ

Artem Bityutskiy dedekind1 at gmail.com
Sun Aug 23 23:32:23 PDT 2015


On Mon, 2015-08-24 at 09:07 +0800, Dongsheng Yang wrote:
> On 08/18/2015 04:52 PM, Artem Bityutskiy wrote:
> > On Tue, 2015-08-18 at 12:52 +0800, Dongsheng Yang wrote:
> > > There is a commit 92ed6c0 to increase UBIFS_MAX_LEB_SZ
> > > to 2MiB. But recently, as the leb size become larger and
> > > larger, 2MiB is not a suitable limit any more.
> > > 
> > > Then remove this check in mkfs.ubifs
> > > 
> > > Signed-off-by: Dongsheng Yang <yangds.fnst at cn.fujitsu.com>
> > > ---
> > > NOTE:
> > > 	I am not sure the reason why we have to
> > > limit the leb size in mkfs.ubifs. Because
> > > I did not find any reason for it, I send
> > > this patch out. It's very possible I am
> > > mising something.
> > 
> > Well, this is sanity check for the user input. If you accidentally
> > added few zeroes, we want to spot this and inform you, and you may
> > appreciate that we did not just created a bugus image for you.
> > That's
> > the idea.
> 
> Sorry, Artem, I was trying to understand it, but I did not got the
> point. Could you give me some more information about the idea? Maybe
> an example?

Well, this is defensive programming concept. Something goes wrong, due
to bad user input and/or a bug we get to this place with an bogus size.
This check catches it and errors out versus we just go forward,
generate a bugus image, which you then flash and find that things do
not work, and then spend your time for further investigations. Nothing
more than that.

Artem.



More information about the linux-mtd mailing list