Skip to content

Commit

Permalink
[PATCH] JFFS2: SUMMARY: fix a summary collecting bug
Browse files Browse the repository at this point in the history
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: Ferenc Havasi <havasi@inf.u-szeged.hu>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Zoltan Sogor authored and Linus Torvalds committed Sep 16, 2006
1 parent 96da960 commit 27bea32
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fs/jffs2/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 27bea32

Please sign in to comment.