Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 27bea327 authored by Zoltan Sogor's avatar Zoltan Sogor Committed by Linus Torvalds
Browse files

[PATCH] 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.

Signed-off-by: default avatarFerenc Havasi <havasi@inf.u-szeged.hu>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 96da9606
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -252,6 +252,11 @@ int jffs2_sum_add_kvec(struct jffs2_sb_info *c, const struct kvec *invecs,
	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;