From: Joern Engel Date: Fri, 5 Aug 2011 09:18:19 +0000 (+0200) Subject: logfs: Free areas before calling generic_shutdown_super() X-Git-Tag: next-20110808~40^2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cc417cd06e2f496d64ac46041bd08287c677ad3d;p=karo-tx-linux.git logfs: Free areas before calling generic_shutdown_super() Or hit an assertion in map_invalidatepage() instead. Signed-off-by: Joern Engel --- diff --git a/fs/logfs/logfs.h b/fs/logfs/logfs.h index 57afd4a6fabb..9e749025d871 100644 --- a/fs/logfs/logfs.h +++ b/fs/logfs/logfs.h @@ -594,6 +594,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); diff --git a/fs/logfs/segment.c b/fs/logfs/segment.c index 9d5187353255..ee7d4aa4a5b7 100644 --- a/fs/logfs/segment.c +++ b/fs/logfs/segment.c @@ -841,6 +841,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; @@ -923,10 +933,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); } diff --git a/fs/logfs/super.c b/fs/logfs/super.c index ce03a182c771..6506e9e392eb 100644 --- a/fs/logfs/super.c +++ b/fs/logfs/super.c @@ -507,6 +507,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