diff options
author | Joern Engel <joern@logfs.org> | 2010-03-29 15:14:52 -0400 |
---|---|---|
committer | Joern Engel <joern@logfs.org> | 2010-03-29 15:14:52 -0400 |
commit | 6be7fa06eb4d721df734bd0946b5e63b27c0589b (patch) | |
tree | 7d4a7381b61c6ab62b71643ec2033f09af2a9ec2 | |
parent | 0943846ae05603efd98550f2d475e9c98191bde8 (diff) |
[LogFS] Erase new journal segments
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>
-rw-r--r-- | fs/logfs/journal.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/logfs/journal.c b/fs/logfs/journal.c index 25b1345c4652..d57c7b07b60b 100644 --- a/fs/logfs/journal.c +++ b/fs/logfs/journal.c | |||
@@ -823,6 +823,8 @@ void do_logfs_journal_wl_pass(struct super_block *sb) | |||
823 | logfs_set_segment_reserved(sb, segno); | 823 | logfs_set_segment_reserved(sb, segno); |
824 | err = btree_insert32(head, segno, (void *)1, GFP_KERNEL); | 824 | err = btree_insert32(head, segno, (void *)1, GFP_KERNEL); |
825 | BUG_ON(err); /* mempool should prevent this */ | 825 | BUG_ON(err); /* mempool should prevent this */ |
826 | err = logfs_erase_segment(sb, segno, 1); | ||
827 | BUG_ON(err); /* FIXME: remount-ro would be nicer */ | ||
826 | } | 828 | } |
827 | /* Manually move journal_area */ | 829 | /* Manually move journal_area */ |
828 | freeseg(sb, area->a_segno); | 830 | freeseg(sb, area->a_segno); |