Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213013
b: refs/heads/master
c: 7d08ae3
h: refs/heads/master
i:
  213011: 7d68faa
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Oct 17, 2010
1 parent 31c88f5 commit 3577d12
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54dd55a406f6e9cb5ae208f258b907455162e045
refs/heads/master: 7d08ae3c9205b559f90c3d7a3abba3c6479673c7
3 changes: 2 additions & 1 deletion trunk/fs/ubifs/recovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ static int get_cs_sqnum(struct ubifs_info *c, int lnum, int offs,
* @sbuf: LEB-sized buffer to use
*
* This function does a scan of a LEB, but caters for errors that might have
* been caused by the unclean unmount from which we are attempting to recover.
* been caused by unclean reboots from which we are attempting to recover
* (assume that only the last log LEB can be corrupted by an unclean reboot).
*
* This function returns %0 on success and a negative error code on failure.
*/
Expand Down
9 changes: 5 additions & 4 deletions trunk/fs/ubifs/replay.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,11 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
if (IS_ERR(sleb)) {
if (PTR_ERR(sleb) != -EUCLEAN || !c->need_recovery)
return PTR_ERR(sleb);
/*
* Note, the below function will recover this log LEB only if
* it is the last, because unclean reboots can possibly corrupt
* only the tail of the log.
*/
sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf);
if (IS_ERR(sleb))
return PTR_ERR(sleb);
Expand All @@ -850,7 +855,6 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
}

node = sleb->buf;

snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list);
if (c->cs_sqnum == 0) {
/*
Expand Down Expand Up @@ -897,7 +901,6 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
}

list_for_each_entry(snod, &sleb->nodes, list) {

cond_resched();

if (snod->sqnum >= SQNUM_WATERMARK) {
Expand Down Expand Up @@ -1030,9 +1033,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
return -ENOMEM;

dbg_mnt("start replaying the journal");

c->replaying = 1;

lnum = c->ltail_lnum = c->lhead_lnum;
offs = c->lhead_offs;

Expand Down

0 comments on commit 3577d12

Please sign in to comment.