summaryrefslogtreecommitdiff
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2011-05-19 04:37:44 +0000
committerChris Mason <chris.mason@oracle.com>2011-05-23 13:24:39 -0400
commit65a246c5ffe3b487a001de025816326939e63362 (patch)
tree52da5b08a584ac3178f8bd35a5e7333f5a3908e1 /fs/btrfs/file-item.c
parentb0b802d7e34b0b4a78f911c3a8aad88aa91fd7ab (diff)
downloadlinux-3.10-65a246c5ffe3b487a001de025816326939e63362.tar.gz
linux-3.10-65a246c5ffe3b487a001de025816326939e63362.tar.bz2
linux-3.10-65a246c5ffe3b487a001de025816326939e63362.zip
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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/file-item.c b/fs/btrfs/file-item.c
index a6a9d4e8b49..6e7556aa02e 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,
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
if (ret > 0) {
if (path->slots[0] == 0)
- goto out;
+ break;
path->slots[0]--;
} else if (ret < 0) {
- goto out;
+ break;
}
leaf = path->nodes[0];
@@ -579,7 +579,8 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
/* delete the entire item, it is inside our range */
if (key.offset >= bytenr && csum_end <= end_byte) {
ret = btrfs_del_item(trans, root, path);
- BUG_ON(ret);
+ if (ret)
+ goto out;
if (key.offset == bytenr)
break;
} else if (key.offset < bytenr && csum_end > end_byte) {
@@ -633,9 +634,10 @@ int btrfs_del_csums(struct btrfs_trans_handle *trans,
}
btrfs_release_path(root, path);
}
+ ret = 0;
out:
btrfs_free_path(path);
- return 0;
+ return ret;
}
int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,