diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2013-05-15 03:48:15 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2013-05-17 21:40:29 -0400 |
commit | 89042e5ad23d50449691141334f30d53d6271266 (patch) | |
tree | 17dd95d87abed2cab31d3c2cc316e85b314a4525 /fs/btrfs/inode.c | |
parent | b9aa55bed1c1a3a329da31884b643c62d57ebb21 (diff) |
Btrfs: fix accessing a freed tree root
inode_tree_del() will move the tree root into the dead root list, and
then the tree will be destroyed by the cleaner. So if we remove the
delayed node which is cached in the inode after inode_tree_del(),
we may access a freed tree root. Fix it.
Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 99a9c25d36a6..790eceb48fb0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4727,6 +4727,7 @@ void btrfs_evict_inode(struct inode *inode) | |||
4727 | btrfs_end_transaction(trans, root); | 4727 | btrfs_end_transaction(trans, root); |
4728 | btrfs_btree_balance_dirty(root); | 4728 | btrfs_btree_balance_dirty(root); |
4729 | no_delete: | 4729 | no_delete: |
4730 | btrfs_remove_delayed_node(inode); | ||
4730 | clear_inode(inode); | 4731 | clear_inode(inode); |
4731 | return; | 4732 | return; |
4732 | } | 4733 | } |
@@ -7982,7 +7983,6 @@ void btrfs_destroy_inode(struct inode *inode) | |||
7982 | inode_tree_del(inode); | 7983 | inode_tree_del(inode); |
7983 | btrfs_drop_extent_cache(inode, 0, (u64)-1, 0); | 7984 | btrfs_drop_extent_cache(inode, 0, (u64)-1, 0); |
7984 | free: | 7985 | free: |
7985 | btrfs_remove_delayed_node(inode); | ||
7986 | call_rcu(&inode->i_rcu, btrfs_i_callback); | 7986 | call_rcu(&inode->i_rcu, btrfs_i_callback); |
7987 | } | 7987 | } |
7988 | 7988 | ||