aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/file-item.c
diff options
context:
space:
mode:
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 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;
636out: 638out:
637 btrfs_free_path(path); 639 btrfs_free_path(path);
638 return 0; 640 return ret;
639} 641}
640 642
641int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans, 643int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,