提交 89042e5a 编写于 作者: M Miao Xie 提交者: Josef Bacik

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: NMiao Xie <miaox@cn.fujitsu.com>
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
上级 b9aa55be
...@@ -4727,6 +4727,7 @@ void btrfs_evict_inode(struct inode *inode) ...@@ -4727,6 +4727,7 @@ void btrfs_evict_inode(struct inode *inode)
btrfs_end_transaction(trans, root); btrfs_end_transaction(trans, root);
btrfs_btree_balance_dirty(root); btrfs_btree_balance_dirty(root);
no_delete: no_delete:
btrfs_remove_delayed_node(inode);
clear_inode(inode); clear_inode(inode);
return; return;
} }
...@@ -7982,7 +7983,6 @@ void btrfs_destroy_inode(struct inode *inode) ...@@ -7982,7 +7983,6 @@ void btrfs_destroy_inode(struct inode *inode)
inode_tree_del(inode); inode_tree_del(inode);
btrfs_drop_extent_cache(inode, 0, (u64)-1, 0); btrfs_drop_extent_cache(inode, 0, (u64)-1, 0);
free: free:
btrfs_remove_delayed_node(inode);
call_rcu(&inode->i_rcu, btrfs_i_callback); call_rcu(&inode->i_rcu, btrfs_i_callback);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册