Btrfs: Avoid calling into the FS for the final iput on fake root inodes
authorChris Mason <chris.mason@oracle.com>
Tue, 5 Aug 2008 17:30:48 +0000 (13:30 -0400)
committerChris Mason <chris.mason@oracle.com>
Thu, 25 Sep 2008 15:04:06 +0000 (11:04 -0400)
Signed-off-by: Chris Mason <chris.mason@oracle.com>
fs/btrfs/disk-io.c
fs/btrfs/inode.c

index 76543683f3b947c3cd83e18e0983b6fff8091f01..56c54a41dbbb3bd917463c94db87c73f5463b8c1 100644 (file)
@@ -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);
index c33053ba381697cfea7f42b5c62586997bb80652..a26d365111e5371a1e5d38853c9bc1ea2efa51aa 100644 (file)
@@ -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);