Skip to content

Commit

Permalink
UBIFS: fix replay regression
Browse files Browse the repository at this point in the history
Commit "d51f17e UBIFS: simplify reply code a bit" introduces a bug with the
following symptoms:

UBIFS error (pid 1): replay_log_leb: first CS node at LEB 3:0 has wrong commit number 0 expected 1

The issue is that we start replaying the log from UBIFS_LOG_LNUM instead
of c->lhead_lnum. This patch fixes that.

Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Artem Bityutskiy committed Aug 21, 2012
1 parent 11e3be0 commit c212f40
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/ubifs/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,6 @@ int ubifs_replay_journal(struct ubifs_info *c)
c->replaying = 1;
lnum = c->ltail_lnum = c->lhead_lnum;

lnum = UBIFS_LOG_LNUM;
do {
err = replay_log_leb(c, lnum, 0, c->sbuf);
if (err == 1)
Expand All @@ -1035,7 +1034,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
if (err)
goto out;
lnum = ubifs_next_log_lnum(c, lnum);
} while (lnum != UBIFS_LOG_LNUM);
} while (lnum != c->ltail_lnum);

err = replay_buds(c);
if (err)
Expand Down

0 comments on commit c212f40

Please sign in to comment.