Skip to content

Commit

Permalink
[JFFS2] Disable summary after wbuf recovery
Browse files Browse the repository at this point in the history
After a write error, any data in the write buffer must
be relocated.  This is handled by the jffs2_wbuf_recover
function.  This function does not fix up the erase block
summary information that is collected for writing at the
end of the block, which results in an incorrect summary
(or BUG if the summary was found to be empty).

As the summary is not essential (it is an optimisation),
it may be disabled for the current erase block when this
situation arises.  This patch does that.

Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
  • Loading branch information
Adrian Hunter authored and David Woodhouse committed Apr 17, 2007
1 parent 99c2594 commit 7f762ab
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/jffs2/wbuf.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,9 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c)
return;
}

/* The summary is not recovered, so it must be disabled for this erase block */
jffs2_sum_disable_collecting(c->summary);

ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, nr_refile);
if (ret) {
printk(KERN_WARNING "Failed to allocate node refs for wbuf recovery. Data loss ensues.\n");
Expand Down

0 comments on commit 7f762ab

Please sign in to comment.