Skip to content

Commit

Permalink
Btrfs: Avoid calling into the FS for the final iput on fake root inodes
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Chris Mason committed Sep 25, 2008
1 parent 7ea394f commit 4ca8b41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/disk-io.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4ca8b41

Please sign in to comment.