aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/replay.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/replay.c')
-rw-r--r--fs/ubifs/replay.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/ubifs/replay.c b/fs/ubifs/replay.c
index 730598cf6342..7df04ba4878e 100644
--- a/fs/ubifs/replay.c
+++ b/fs/ubifs/replay.c
@@ -839,6 +839,11 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
839 if (IS_ERR(sleb)) { 839 if (IS_ERR(sleb)) {
840 if (PTR_ERR(sleb) != -EUCLEAN || !c->need_recovery) 840 if (PTR_ERR(sleb) != -EUCLEAN || !c->need_recovery)
841 return PTR_ERR(sleb); 841 return PTR_ERR(sleb);
842 /*
843 * Note, the below function will recover this log LEB only if
844 * it is the last, because unclean reboots can possibly corrupt
845 * only the tail of the log.
846 */
842 sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf); 847 sleb = ubifs_recover_log_leb(c, lnum, offs, sbuf);
843 if (IS_ERR(sleb)) 848 if (IS_ERR(sleb))
844 return PTR_ERR(sleb); 849 return PTR_ERR(sleb);
@@ -850,7 +855,6 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
850 } 855 }
851 856
852 node = sleb->buf; 857 node = sleb->buf;
853
854 snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list); 858 snod = list_entry(sleb->nodes.next, struct ubifs_scan_node, list);
855 if (c->cs_sqnum == 0) { 859 if (c->cs_sqnum == 0) {
856 /* 860 /*
@@ -897,7 +901,6 @@ static int replay_log_leb(struct ubifs_info *c, int lnum, int offs, void *sbuf)
897 } 901 }
898 902
899 list_for_each_entry(snod, &sleb->nodes, list) { 903 list_for_each_entry(snod, &sleb->nodes, list) {
900
901 cond_resched(); 904 cond_resched();
902 905
903 if (snod->sqnum >= SQNUM_WATERMARK) { 906 if (snod->sqnum >= SQNUM_WATERMARK) {
@@ -1030,9 +1033,7 @@ int ubifs_replay_journal(struct ubifs_info *c)
1030 return -ENOMEM; 1033 return -ENOMEM;
1031 1034
1032 dbg_mnt("start replaying the journal"); 1035 dbg_mnt("start replaying the journal");
1033
1034 c->replaying = 1; 1036 c->replaying = 1;
1035
1036 lnum = c->ltail_lnum = c->lhead_lnum; 1037 lnum = c->ltail_lnum = c->lhead_lnum;
1037 offs = c->lhead_offs; 1038 offs = c->lhead_offs;
1038 1039