From: Artem Bityutskiy <dedekind1@gmail.com>
To: Anatolij Gustschin <agust@denx.de>
Cc: linux-mtd@lists.infradead.org, Detlev Zundel <dzu@denx.de>
Subject: Re: [PATCH] UBIFS: fix master node recovery
Date: Thu, 07 Jul 2011 11:57:04 +0300 [thread overview]
Message-ID: <1310029028.3149.143.camel@sauron> (raw)
In-Reply-To: <20110707104448.7f6f0cea@wker>
On Thu, 2011-07-07 at 10:44 +0200, Anatolij Gustschin wrote:
> On Thu, 07 Jul 2011 10:57:05 +0300
> Artem Bityutskiy <dedekind1@gmail.com> wrote:
>
> > On Thu, 2011-07-07 at 09:43 +0200, Anatolij Gustschin wrote:
> > > Yes, in our case we have 511 valid master nodes + 384 bytes free
> > > space in LEB 2 and one valid master node in LEB 1 + free space.
> > >
> > > > What we want to check is that there is no room for another master node
> > > > in the second LEB. We have to take offs2, add sz, and make sure that LEB
> > > > size minus that is less than sz, i.e., exactly what you have done.
> > > >
> > > > And offs2 + sz >= c->leb_size seems to be completely incorrect and
> > > > should be removed, AFAICS. Can you confirm that?
> > >
> > > Yes, offs2 + sz >= c->leb_size check is not correct, I think.
> >
> > I also think so. Could you send v2 of your patch - kill the incorrect
> > check and add your correct check instead.
>
> 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?
--
Best Regards,
Artem Bityutskiy
next prev parent reply other threads:[~2011-07-07 8:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-06 9:30 [PATCH] UBIFS: fix master node recovery Anatolij Gustschin
2011-07-07 6:15 ` Artem Bityutskiy
2011-07-07 7:36 ` Anatolij Gustschin
2011-07-07 6:26 ` Artem Bityutskiy
2011-07-07 7:43 ` Anatolij Gustschin
2011-07-07 7:57 ` Artem Bityutskiy
2011-07-07 8:44 ` Anatolij Gustschin
2011-07-07 8:57 ` Artem Bityutskiy [this message]
2011-07-07 9:05 ` Anatolij Gustschin
2011-07-07 9:51 ` [PATCH v2] " Anatolij Gustschin
2011-07-07 9:55 ` Artem Bityutskiy
2011-07-07 10:25 ` [PATCH v3] " Anatolij Gustschin
2011-07-08 3:55 ` Artem Bityutskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1310029028.3149.143.camel@sauron \
--to=dedekind1@gmail.com \
--cc=agust@denx.de \
--cc=dzu@denx.de \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.