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/file-item.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/file-item.c')
-rw-r--r-- | fs/btrfs/file-item.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c index a6a9d4e8b491..6e7556aa02e8 100644 --- a/fs/btrfs/file-item.c +++ b/fs/btrfs/file-item.c | |||
@@ -551,10 +551,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, | |||
551 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); | 551 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); |
552 | if (ret > 0) { | 552 | if (ret > 0) { |
553 | if (path->slots[0] == 0) | 553 | if (path->slots[0] == 0) |
554 | goto out; | 554 | break; |
555 | path->slots[0]--; | 555 | path->slots[0]--; |
556 | } else if (ret < 0) { | 556 | } else if (ret < 0) { |
557 | goto out; | 557 | break; |
558 | } | 558 | } |
559 | 559 | ||
560 | leaf = path->nodes[0]; | 560 | leaf = path->nodes[0]; |
@@ -579,7 +579,8 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, | |||
579 | /* delete the entire item, it is inside our range */ | 579 | /* delete the entire item, it is inside our range */ |
580 | if (key.offset >= bytenr && csum_end <= end_byte) { | 580 | if (key.offset >= bytenr && csum_end <= end_byte) { |
581 | ret = btrfs_del_item(trans, root, path); | 581 | ret = btrfs_del_item(trans, root, path); |
582 | BUG_ON(ret); | 582 | if (ret) |
583 | goto out; | ||
583 | if (key.offset == bytenr) | 584 | if (key.offset == bytenr) |
584 | break; | 585 | break; |
585 | } else if (key.offset < bytenr && csum_end > end_byte) { | 586 | } else if (key.offset < bytenr && csum_end > end_byte) { |
@@ -633,9 +634,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans, | |||
633 | } | 634 | } |
634 | btrfs_release_path(root, path); | 635 | btrfs_release_path(root, path); |
635 | } | 636 | } |
637 | ret = 0; | ||
636 | out: | 638 | out: |
637 | btrfs_free_path(path); | 639 | btrfs_free_path(path); |
638 | return 0; | 640 | return ret; |
639 | } | 641 | } |
640 | 642 | ||
641 | int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, | 643 | int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, |