diff options
author | Tsutomu Itoh <t-itoh@jp.fujitsu.com> | 2011-05-19 00:37:44 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-05-23 13:24:39 -0400 |
commit | 65a246c5ffe3b487a001de025816326939e63362 (patch) | |
tree | 52da5b08a584ac3178f8bd35a5e7333f5a3908e1 /fs/btrfs/root-tree.c | |
parent | b0b802d7e34b0b4a78f911c3a8aad88aa91fd7ab (diff) |
Btrfs: return error code to caller when btrfs_del_item fails
The error code is returned instead of calling BUG_ON when
btrfs_del_item returns the error.
Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/root-tree.c')
-rw-r--r-- | fs/btrfs/root-tree.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index 6928bff62daa..2cf5f5142159 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -385,7 +385,10 @@ again: | |||
385 | *sequence = btrfs_root_ref_sequence(leaf, ref); | 385 | *sequence = btrfs_root_ref_sequence(leaf, ref); |
386 | 386 | ||
387 | ret = btrfs_del_item(trans, tree_root, path); | 387 | ret = btrfs_del_item(trans, tree_root, path); |
388 | BUG_ON(ret); | 388 | if (ret) { |
389 | err = ret; | ||
390 | goto out; | ||
391 | } | ||
389 | } else | 392 | } else |
390 | err = -ENOENT; | 393 | err = -ENOENT; |
391 | 394 | ||
@@ -397,6 +400,7 @@ again: | |||
397 | goto again; | 400 | goto again; |
398 | } | 401 | } |
399 | 402 | ||
403 | out: | ||
400 | btrfs_free_path(path); | 404 | btrfs_free_path(path); |
401 | return err; | 405 | return err; |
402 | } | 406 | } |