Skip to content

Commit

Permalink
UBIFS: double check that buds are replied in order
Browse files Browse the repository at this point in the history
Commit 52c6e6f provides misleading infomation
in the commit messages - buds are replied in order. And the real reason why
that fix helped is probably because it made sure we seek head even in read-only
mode (so deferred recovery will have seeked heads).

This patch adds an assertion which will fire if we reply buds out of order.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed May 16, 2011
1 parent e9ef7b5 commit 7703f09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/ubifs/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,7 @@ static int replay_buds(struct ubifs_info *c)
{
struct bud_entry *b;
int err, uninitialized_var(free), uninitialized_var(dirty);
unsigned long long prev_sqnum = 0;

list_for_each_entry(b, &c->replay_buds, list) {
err = replay_bud(c, b->bud->lnum, b->bud->start, b->bud->jhead,
Expand All @@ -723,6 +724,9 @@ static int replay_buds(struct ubifs_info *c)
free, dirty, b->bud->jhead);
if (err)
return err;

ubifs_assert(b->sqnum > prev_sqnum);
prev_sqnum = b->sqnum;
}

return 0;
Expand Down

0 comments on commit 7703f09

Please sign in to comment.