aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-12-17 20:14:04 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commitd10c5f31c79c6a703974ae29d0a05781b828fe30 (patch)
tree83845c1b41e665ddfb542e8d7a7cd7ad86bd3c59 /fs/btrfs/disk-io.c
parentbe20aa9dbadc8c06283784ee12bbc0d97dea3418 (diff)
Btrfs: Fix extent_map and extent_state leaks by flushing lrus on FS unmount
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 4338b00c2a25..278564178993 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -765,8 +765,18 @@ int close_ctree(struct btrfs_root *root)
765 765
766 btrfs_free_block_groups(root->fs_info); 766 btrfs_free_block_groups(root->fs_info);
767 del_fs_roots(fs_info); 767 del_fs_roots(fs_info);
768
769 filemap_write_and_wait(fs_info->btree_inode->i_mapping);
770
771 extent_map_tree_empty_lru(&fs_info->free_space_cache);
772 extent_map_tree_empty_lru(&fs_info->block_group_cache);
773 extent_map_tree_empty_lru(&fs_info->pinned_extents);
774 extent_map_tree_empty_lru(&fs_info->pending_del);
775 extent_map_tree_empty_lru(&fs_info->extent_ins);
768 extent_map_tree_empty_lru(&BTRFS_I(fs_info->btree_inode)->extent_tree); 776 extent_map_tree_empty_lru(&BTRFS_I(fs_info->btree_inode)->extent_tree);
777
769 truncate_inode_pages(fs_info->btree_inode->i_mapping, 0); 778 truncate_inode_pages(fs_info->btree_inode->i_mapping, 0);
779
770 iput(fs_info->btree_inode); 780 iput(fs_info->btree_inode);
771#if 0 781#if 0
772 while(!list_empty(&fs_info->hashers)) { 782 while(!list_empty(&fs_info->hashers)) {