Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 168555
b: refs/heads/master
c: a6dbd42
h: refs/heads/master
i:
  168553: ba624d9
  168551: b924c74
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Nov 11, 2009
1 parent 495f973 commit af153f3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33b258086441dd07e00133c79fcd8cbc6a76d737
refs/heads/master: a6dbd429d8dd3382bbd9594b8d2ec74843a260d9
10 changes: 10 additions & 0 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5180,6 +5180,7 @@ struct inode *btrfs_alloc_inode(struct super_block *sb)
ei->logged_trans = 0;
ei->outstanding_extents = 0;
ei->reserved_extents = 0;
ei->root = NULL;
spin_lock_init(&ei->accounting_lock);
btrfs_ordered_inode_tree_init(&ei->ordered_tree);
INIT_LIST_HEAD(&ei->i_orphan);
Expand All @@ -5195,6 +5196,14 @@ void btrfs_destroy_inode(struct inode *inode)
WARN_ON(!list_empty(&inode->i_dentry));
WARN_ON(inode->i_data.nrpages);

/*
* This can happen where we create an inode, but somebody else also
* created the same inode and we need to destroy the one we already
* created.
*/
if (!root)
goto free;

/*
* Make sure we're properly removed from the ordered operation
* lists.
Expand Down Expand Up @@ -5230,6 +5239,7 @@ void btrfs_destroy_inode(struct inode *inode)
}
inode_tree_del(inode);
btrfs_drop_extent_cache(inode, 0, (u64)-1, 0);
free:
kmem_cache_free(btrfs_inode_cachep, BTRFS_I(inode));
}

Expand Down

0 comments on commit af153f3

Please sign in to comment.