[PATCH] UBIFS: fix master node recovery

Anatolij Gustschin agust at denx.de
Thu Jul 7 05:05:46 EDT 2011


On Thu, 07 Jul 2011 11:57:04 +0300
Artem Bityutskiy <dedekind1 at gmail.com> wrote:
...
> > Thinking more about this I can imagine the situation where
> > off2 + sz == c->leb_size condition is true (depending on LEB size,
> > node alignment, etc.), so we should check for this condition also.
> > off2 + sz > c->leb_size can't be the case since off2 is the offset
> > of a valid node. So we should check for
> > off2 + sz == c->leb_size || (c->leb_size - offs2 - sz) < sz.
> 
> If offs2 + sz == c->leb_size, then we end up with
> 
> 0 < sz, which will be true, and everything should be fine, no?

Yes, you are right, I didn't though about this.

Thanks,
Anatolij



More information about the linux-mtd mailing list