]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
logfs: Free areas before calling generic_shutdown_super()
authorJoern Engel <joern@logfs.org>
Fri, 5 Aug 2011 09:18:19 +0000 (11:18 +0200)
committerPrasad Joshi <prasadjoshi.linux@gmail.com>
Sat, 28 Jan 2012 06:12:39 +0000 (11:42 +0530)
Or hit an assertion in map_invalidatepage() instead.

Signed-off-by: Joern Engel <joern@logfs.org>
fs/logfs/logfs.h
fs/logfs/segment.c
fs/logfs/super.c

index 0dec29887a8a89b12cbef270af181892b4ea2cd0..59ed32cd62d1245dcce5772124290390c55a3f2c 100644 (file)
@@ -596,6 +596,7 @@ int logfs_init_mapping(struct super_block *sb);
 void logfs_sync_area(struct logfs_area *area);
 void logfs_sync_segments(struct super_block *sb);
 void freeseg(struct super_block *sb, u32 segno);
+void free_areas(struct super_block *sb);
 
 /* area handling */
 int logfs_init_areas(struct super_block *sb);
index 6aee6092860df3d0ffb81e9b606df20d700d9b9f..ab798ed1cc8839e2c9c97eb87d7bedff64693fa4 100644 (file)
@@ -862,6 +862,16 @@ static void free_area(struct logfs_area *area)
        kfree(area);
 }
 
+void free_areas(struct super_block *sb)
+{
+       struct logfs_super *super = logfs_super(sb);
+       int i;
+
+       for_each_area(i)
+               free_area(super->s_area[i]);
+       free_area(super->s_journal_area);
+}
+
 static struct logfs_area *alloc_area(struct super_block *sb)
 {
        struct logfs_area *area;
@@ -944,10 +954,6 @@ err:
 void logfs_cleanup_areas(struct super_block *sb)
 {
        struct logfs_super *super = logfs_super(sb);
-       int i;
 
        btree_grim_visitor128(&super->s_object_alias_tree, 0, kill_alias);
-       for_each_area(i)
-               free_area(super->s_area[i]);
-       free_area(super->s_journal_area);
 }
index f9b7a30b00a356396c54073c493620441df1b234..c9ee7f5d1cafe2c66bd5edab9dc0240feb6f68ff 100644 (file)
@@ -486,6 +486,7 @@ static void logfs_kill_sb(struct super_block *sb)
        /* Alias entries slow down mount, so evict as many as possible */
        sync_filesystem(sb);
        logfs_write_anchor(sb);
+       free_areas(sb);
 
        /*
         * From this point on alias entries are simply dropped - and any