summaryrefslogtreecommitdiff
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2011-07-19 07:27:20 +0000
committerChris Mason <chris.mason@oracle.com>2011-08-01 14:30:42 -0400
commitb532402e4d147e4f409c4e7f50d4413e8450101d (patch)
tree0c196fd362d03243704a47e69e41c13acd323bd0 /fs/btrfs/extent-tree.c
parenta0f98dde11a1afe9fbf5c98f57968e086e98b6f5 (diff)
downloadlwn-b532402e4d147e4f409c4e7f50d4413e8450101d.tar.gz
lwn-b532402e4d147e4f409c4e7f50d4413e8450101d.zip
Btrfs: return error to caller when btrfs_unlink() failes
When btrfs_unlink_inode() and btrfs_orphan_add() in btrfs_unlink() are error, the error code is returned to the caller instead of BUG_ON(). Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 55bddffede73..db2057f262ad 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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);