diff options
author | Adrian Hunter <ext-adrian.hunter@nokia.com> | 2007-04-04 06:47:53 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2007-04-17 13:56:44 -0400 |
commit | 7f762ab24ca2215b69a1395b5b58877f8282a089 (patch) | |
tree | 38774bcd57912c5d6506959c86ee639cdeebe7b3 /fs/jffs2 | |
parent | 99c2594f0e13de1ca84f97efc3f9e7bc49f91e11 (diff) |
[JFFS2] Disable summary after wbuf recovery
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>
Diffstat (limited to 'fs/jffs2')
-rw-r--r-- | fs/jffs2/wbuf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c index 4fac6dd53954..f9da0e755a3e 100644 --- a/fs/jffs2/wbuf.c +++ b/fs/jffs2/wbuf.c | |||
@@ -345,6 +345,9 @@ static void jffs2_wbuf_recover(struct jffs2_sb_info *c) | |||
345 | return; | 345 | return; |
346 | } | 346 | } |
347 | 347 | ||
348 | /* The summary is not recovered, so it must be disabled for this erase block */ | ||
349 | jffs2_sum_disable_collecting(c->summary); | ||
350 | |||
348 | ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, nr_refile); | 351 | ret = jffs2_prealloc_raw_node_refs(c, c->nextblock, nr_refile); |
349 | if (ret) { | 352 | if (ret) { |
350 | printk(KERN_WARNING "Failed to allocate node refs for wbuf recovery. Data loss ensues.\n"); | 353 | printk(KERN_WARNING "Failed to allocate node refs for wbuf recovery. Data loss ensues.\n"); |