Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262232
b: refs/heads/master
c: b532402
h: refs/heads/master
v: v3
  • Loading branch information
Tsutomu Itoh authored and Chris Mason committed Aug 1, 2011
1 parent ba84089 commit 1898f43
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0f98dde11a1afe9fbf5c98f57968e086e98b6f5
refs/heads/master: b532402e4d147e4f409c4e7f50d4413e8450101d
3 changes: 2 additions & 1 deletion trunk/fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -7201,7 +7201,8 @@ int btrfs_remove_block_group(struct btrfs_trans_handle *trans,

inode = lookup_free_space_inode(root, block_group, path);
if (!IS_ERR(inode)) {
btrfs_orphan_add(trans, inode);
ret = btrfs_orphan_add(trans, inode);
BUG_ON(ret);
clear_nlink(inode);
/* One for the block groups ref */
spin_lock(&block_group->lock);
Expand Down
10 changes: 7 additions & 3 deletions trunk/fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2217,7 +2217,8 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode)

if (!root->orphan_block_rsv) {
block_rsv = btrfs_alloc_block_rsv(root);
BUG_ON(!block_rsv);
if (!block_rsv)
return -ENOMEM;
}

spin_lock(&root->orphan_lock);
Expand Down Expand Up @@ -3002,13 +3003,16 @@ static int btrfs_unlink(struct inode *dir, struct dentry *dentry)

ret = btrfs_unlink_inode(trans, root, dir, dentry->d_inode,
dentry->d_name.name, dentry->d_name.len);
BUG_ON(ret);
if (ret)
goto out;

if (inode->i_nlink == 0) {
ret = btrfs_orphan_add(trans, inode);
BUG_ON(ret);
if (ret)
goto out;
}

out:
nr = trans->blocks_used;
__unlink_end_trans(trans, root);
btrfs_btree_balance_dirty(root, nr);
Expand Down

0 comments on commit 1898f43

Please sign in to comment.