diff options
author | Joern Engel <joern@logfs.org> | 2011-08-05 05:18:19 -0400 |
---|---|---|
committer | Prasad Joshi <prasadjoshi.linux@gmail.com> | 2012-01-28 01:12:39 -0500 |
commit | 1bcceaff8cbe5e5698ccf1015c9a938aa72718c4 (patch) | |
tree | 2e36c3d9d5577dbfd3998cab37576a8761cf18fa | |
parent | 6c69494f6b442834f26377e02d43fc8e1272221d (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.h | 1 | ||||
-rw-r--r-- | fs/logfs/segment.c | 14 | ||||
-rw-r--r-- | fs/logfs/super.c | 1 |
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); | |||
596 | void logfs_sync_area(struct logfs_area *area); | 596 | void logfs_sync_area(struct logfs_area *area); |
597 | void logfs_sync_segments(struct super_block *sb); | 597 | void logfs_sync_segments(struct super_block *sb); |
598 | void freeseg(struct super_block *sb, u32 segno); | 598 | void freeseg(struct super_block *sb, u32 segno); |
599 | void free_areas(struct super_block *sb); | ||
599 | 600 | ||
600 | /* area handling */ | 601 | /* area handling */ |
601 | int logfs_init_areas(struct super_block *sb); | 602 | int 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 | ||
865 | void 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 | |||
865 | static struct logfs_area *alloc_area(struct super_block *sb) | 875 | static 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: | |||
944 | void logfs_cleanup_areas(struct super_block *sb) | 954 | void 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 |