Skip to contentSkip to conversation

Disable summary after wbuf recovery

PATCH New Adrian Hunter 1 participant 1 message Apr 4, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
fs/jffs2/wbuf.c | 3 +++

1 files changed, 3 insertions(+), 0 deletions(-)
fs/jffs2/wbuf.c +0 -0
index 4fac6dd..f9da0e7 100644
@@ -345,6 +345,9 @@ static void jffs2_wbuf_recover(struct jf
		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");
Signature · 1 line
1.4.3