aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2/erase.c
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2008-04-22 20:17:51 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2008-04-22 20:24:17 -0400
commit85a62db6245a82f07a31b387915ee2180b9ea11a (patch)
tree9de37a0f9267f92aac41e817c5e8fec6887400a1 /fs/jffs2/erase.c
parent014b164e1392a166fe96e003d2f0e7ad2e2a0bb7 (diff)
[JFFS2] Add paranoia debugging for superblock counts
The problem fixed in commit 014b164e1392a166fe96e003d2f0e7ad2e2a0bb7 (space leak with in-band cleanmarkers) would have been caught a lot quicker if our paranoid debugging mode had included adding up the size counts from all the eraseblocks and comparing the totals with the counts in the superblock. Add that. Make jffs2_mark_erased_block() file the newly-erased block on the free_list before calling the debug function, to make it happy. Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'fs/jffs2/erase.c')
-rw-r--r--fs/jffs2/erase.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index bdc6a7bec802..65d91943fc2d 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -460,12 +460,13 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
460 if (c->cleanmarker_size && !jffs2_cleanmarker_oob(c)) 460 if (c->cleanmarker_size && !jffs2_cleanmarker_oob(c))
461 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL); 461 jffs2_link_node_ref(c, jeb, jeb->offset | REF_NORMAL, c->cleanmarker_size, NULL);
462 462
463 jffs2_dbg_acct_sanity_check_nolock(c,jeb);
464 jffs2_dbg_acct_paranoia_check_nolock(c, jeb);
465
466 list_add_tail(&jeb->list, &c->free_list); 463 list_add_tail(&jeb->list, &c->free_list);
467 c->nr_erasing_blocks--; 464 c->nr_erasing_blocks--;
468 c->nr_free_blocks++; 465 c->nr_free_blocks++;
466
467 jffs2_dbg_acct_sanity_check_nolock(c, jeb);
468 jffs2_dbg_acct_paranoia_check_nolock(c, jeb);
469
469 spin_unlock(&c->erase_completion_lock); 470 spin_unlock(&c->erase_completion_lock);
470 mutex_unlock(&c->erase_free_sem); 471 mutex_unlock(&c->erase_free_sem);
471 wake_up(&c->erase_wait); 472 wake_up(&c->erase_wait);