[JFFS2][SUMMARY] Fix a summary collecting bug.

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sat Sep 16 04:59:01 EDT 2006


Commit:     d882687c51b52424a56992578ce7636b3f3c8d41
Parent:     fa6c220a7f01257b1c2c4203d48aaaedb0c4416f
commit d882687c51b52424a56992578ce7636b3f3c8d41
Author:     Havasi Ferenc <haf at kpax.(none)>
AuthorDate: Tue Sep 5 16:08:58 2006 +0200
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Sat Sep 16 09:08:12 2006 +0100

    [JFFS2][SUMMARY] Fix a summary collecting bug.
    
    In some special case (padding because of sync
    or umount) it can be possible that summary
    information is not fit to the end of the erase
    block. In these cases the collecting of summary
    is disabled for this erase block.
    
    The problem was that this was not respected
    by jffs2_sum_add_kvec(). This patch fix this
    bug.
    
    From: Zoltan Sogor <weth at inf.u-szeged.hu>
    Signed-off-by: Ferenc Havasi <havasi at inf.u-szeged.hu>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 fs/jffs2/summary.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/fs/jffs2/summary.c b/fs/jffs2/summary.c
index c19bd47..e52cef5 100644
--- a/fs/jffs2/summary.c
+++ b/fs/jffs2/summary.c
@@ -252,6 +252,11 @@ int jffs2_sum_add_kvec(struct jffs2_sb_i
 	union jffs2_node_union *node;
 	struct jffs2_eraseblock *jeb;
 
+	if (c->summary->sum_size == JFFS2_SUMMARY_NOSUM_SIZE) {
+		dbg_summary("Summary is disabled for this jeb! Skipping summary info!\n");
+		return 0;
+	}
+
 	node = invecs[0].iov_base;
 	jeb = &c->blocks[ofs / c->sector_size];
 	ofs -= jeb->offset;



More information about the linux-mtd-cvs mailing list