From: Chris Mason Date: Tue, 5 Aug 2008 17:30:48 +0000 (-0400) Subject: Btrfs: Avoid calling into the FS for the final iput on fake root inodes X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4ca8b41e3fe76cc5774fbcc6cba64259d69e0f96;p=linux-beck.git Btrfs: Avoid calling into the FS for the final iput on fake root inodes Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 76543683f3b9..56c54a41dbbb 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -1739,6 +1739,7 @@ int close_ctree(struct btrfs_root *root) free_extent_buffer(root->fs_info->dev_root->node); btrfs_free_block_groups(root->fs_info); + fs_info->closing = 2; del_fs_roots(fs_info); filemap_write_and_wait(fs_info->btree_inode->i_mapping); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index c33053ba3816..a26d365111e5 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2092,6 +2092,9 @@ int btrfs_write_inode(struct inode *inode, int wait) struct btrfs_trans_handle *trans; int ret = 0; + if (root->fs_info->closing > 1) + return 0; + if (wait) { trans = btrfs_join_transaction(root, 1); btrfs_set_trans_block_group(trans, inode);