Skip to content

Commit

Permalink
[LogFS] Erase new journal segments
Browse files Browse the repository at this point in the history
If the device contains on old logfs image and the journal is moved to
segment that have never been used by the current logfs and not all
journal segments are erased before the next mount, the old content can
confuse mount code.  To prevent this, always erase the new journal
segments.

Signed-off-by: Joern Engel <joern@logfs.org>
  • Loading branch information
Joern Engel committed Mar 29, 2010
1 parent 0943846 commit 6be7fa0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/logfs/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -823,6 +823,8 @@ void do_logfs_journal_wl_pass(struct super_block *sb)
logfs_set_segment_reserved(sb, segno);
err = btree_insert32(head, segno, (void *)1, GFP_KERNEL);
BUG_ON(err); /* mempool should prevent this */
err = logfs_erase_segment(sb, segno, 1);
BUG_ON(err); /* FIXME: remount-ro would be nicer */
}
/* Manually move journal_area */
freeseg(sb, area->a_segno);
Expand Down

0 comments on commit 6be7fa0

Please sign in to comment.