aboutsummaryrefslogtreecommitdiffstats
path: root/fs/logfs/segment.c
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2010-03-04 15:30:58 -0500
committerJoern Engel <joern@logfs.org>2010-03-04 15:30:58 -0500
commit9421502b4fc894cc477be8fc49776830e37ca157 (patch)
tree9c9b1bfa42b2acdf4b5e080a256c3cd37852a94f /fs/logfs/segment.c
parent5c564c2a04d4bb6ba79eeb83bd06de584479f362 (diff)
[LogFS] Fix bdev erases
Erases for block devices were always just emulated by writing 0xff. Some time back the write was removed and only the page cache was changed to 0xff. Superficialy a good idea with two problems: 1. Touching the page cache isn't necessary either. 2. However, writing out 0xff _is_ necessary for the journal. As the journal is scanned linearly, an old non-overwritten commit entry can be used on next mount and cause havoc. This should fix both aspects.
Diffstat (limited to 'fs/logfs/segment.c')
-rw-r--r--fs/logfs/segment.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
index 5f58b74516ca..664cd0dd3576 100644
--- a/fs/logfs/segment.c
+++ b/fs/logfs/segment.c
@@ -25,14 +25,14 @@ static int logfs_mark_segment_bad(struct super_block *sb, u32 segno)
25 return 0; 25 return 0;
26} 26}
27 27
28int logfs_erase_segment(struct super_block *sb, u32 segno) 28int logfs_erase_segment(struct super_block *sb, u32 segno, int ensure_erase)
29{ 29{
30 struct logfs_super *super = logfs_super(sb); 30 struct logfs_super *super = logfs_super(sb);
31 31
32 super->s_gec++; 32 super->s_gec++;
33 33
34 return super->s_devops->erase(sb, (u64)segno << super->s_segshift, 34 return super->s_devops->erase(sb, (u64)segno << super->s_segshift,
35 super->s_segsize); 35 super->s_segsize, ensure_erase);
36} 36}
37 37
38static s64 logfs_get_free_bytes(struct logfs_area *area, size_t bytes) 38static s64 logfs_get_free_bytes(struct logfs_area *area, size_t bytes)
@@ -798,7 +798,7 @@ static int ostore_erase_segment(struct logfs_area *area)
798 u64 ofs; 798 u64 ofs;
799 int err; 799 int err;
800 800
801 err = logfs_erase_segment(sb, area->a_segno); 801 err = logfs_erase_segment(sb, area->a_segno, 0);
802 if (err) 802 if (err)
803 return err; 803 return err;
804 804