aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoern Engel <joern@logfs.org>2011-08-05 05:18:19 -0400
committerPrasad Joshi <prasadjoshi.linux@gmail.com>2012-01-28 01:12:39 -0500
commit1bcceaff8cbe5e5698ccf1015c9a938aa72718c4 (patch)
tree2e36c3d9d5577dbfd3998cab37576a8761cf18fa
parent6c69494f6b442834f26377e02d43fc8e1272221d (diff)
logfs: Free areas before calling generic_shutdown_super()
Or hit an assertion in map_invalidatepage() instead. Signed-off-by: Joern Engel <joern@logfs.org>
-rw-r--r--fs/logfs/logfs.h1
-rw-r--r--fs/logfs/segment.c14
-rw-r--r--fs/logfs/super.c1
3 files changed, 12 insertions, 4 deletions
diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h
index 0dec29887a8a..59ed32cd62d1 100644
--- a/fs/logfs/logfs.h
+++ b/fs/logfs/logfs.h
@@ -596,6 +596,7 @@ int logfs_init_mapping(struct super_block *sb);
596void logfs_sync_area(struct logfs_area *area); 596void logfs_sync_area(struct logfs_area *area);
597void logfs_sync_segments(struct super_block *sb); 597void logfs_sync_segments(struct super_block *sb);
598void freeseg(struct super_block *sb, u32 segno); 598void freeseg(struct super_block *sb, u32 segno);
599void free_areas(struct super_block *sb);
599 600
600/* area handling */ 601/* area handling */
601int logfs_init_areas(struct super_block *sb); 602int logfs_init_areas(struct super_block *sb);
diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c
index 6aee6092860d..ab798ed1cc88 100644
--- a/fs/logfs/segment.c
+++ b/fs/logfs/segment.c
@@ -862,6 +862,16 @@ static void free_area(struct logfs_area *area)
862 kfree(area); 862 kfree(area);
863} 863}
864 864
865void free_areas(struct super_block *sb)
866{
867 struct logfs_super *super = logfs_super(sb);
868 int i;
869
870 for_each_area(i)
871 free_area(super->s_area[i]);
872 free_area(super->s_journal_area);
873}
874
865static struct logfs_area *alloc_area(struct super_block *sb) 875static struct logfs_area *alloc_area(struct super_block *sb)
866{ 876{
867 struct logfs_area *area; 877 struct logfs_area *area;
@@ -944,10 +954,6 @@ err:
944void logfs_cleanup_areas(struct super_block *sb) 954void logfs_cleanup_areas(struct super_block *sb)
945{ 955{
946 struct logfs_super *super = logfs_super(sb); 956 struct logfs_super *super = logfs_super(sb);
947 int i;
948 957
949 btree_grim_visitor128(&super->s_object_alias_tree, 0, kill_alias); 958 btree_grim_visitor128(&super->s_object_alias_tree, 0, kill_alias);
950 for_each_area(i)
951 free_area(super->s_area[i]);
952 free_area(super->s_journal_area);
953} 959}
diff --git a/fs/logfs/super.c b/fs/logfs/super.c
index f9b7a30b00a3..c9ee7f5d1caf 100644
--- a/fs/logfs/super.c
+++ b/fs/logfs/super.c
@@ -486,6 +486,7 @@ static void logfs_kill_sb(struct super_block *sb)
486 /* Alias entries slow down mount, so evict as many as possible */ 486 /* Alias entries slow down mount, so evict as many as possible */
487 sync_filesystem(sb); 487 sync_filesystem(sb);
488 logfs_write_anchor(sb); 488 logfs_write_anchor(sb);
489 free_areas(sb);
489 490
490 /* 491 /*
491 * From this point on alias entries are simply dropped - and any 492 * From this point on alias entries are simply dropped - and any