Skip to content

Commit

Permalink
Btrfs: Fix extent_map and extent_state leaks by flushing lrus on FS u…
Browse files Browse the repository at this point in the history
…nmount

Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent be20aa9 commit d10c5f3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,18 @@ int close_ctree(struct btrfs_root *root)

btrfs_free_block_groups(root->fs_info);
del_fs_roots(fs_info);

filemap_write_and_wait(fs_info->btree_inode->i_mapping);

extent_map_tree_empty_lru(&fs_info->free_space_cache);
extent_map_tree_empty_lru(&fs_info->block_group_cache);
extent_map_tree_empty_lru(&fs_info->pinned_extents);
extent_map_tree_empty_lru(&fs_info->pending_del);
extent_map_tree_empty_lru(&fs_info->extent_ins);
extent_map_tree_empty_lru(&BTRFS_I(fs_info->btree_inode)->extent_tree);

truncate_inode_pages(fs_info->btree_inode->i_mapping, 0);

iput(fs_info->btree_inode);
#if 0
while(!list_empty(&fs_info->hashers)) {
Expand Down

0 comments on commit d10c5f3

Please sign in to comment.