aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/backref.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index ba0fee7c3237..66f44c7534d0 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -582,7 +582,8 @@ static int __add_delayed_refs(struct btrfs_delayed_ref_head *head, u64 seq,
582 default: 582 default:
583 WARN_ON(1); 583 WARN_ON(1);
584 } 584 }
585 BUG_ON(ret); 585 if (ret)
586 return ret;
586 } 587 }
587 588
588 return 0; 589 return 0;
@@ -680,7 +681,8 @@ static int __add_inline_refs(struct btrfs_fs_info *fs_info,
680 default: 681 default:
681 WARN_ON(1); 682 WARN_ON(1);
682 } 683 }
683 BUG_ON(ret); 684 if (ret)
685 return ret;
684 ptr += btrfs_extent_inline_ref_size(type); 686 ptr += btrfs_extent_inline_ref_size(type);
685 } 687 }
686 688
@@ -762,7 +764,9 @@ static int __add_keyed_refs(struct btrfs_fs_info *fs_info,
762 default: 764 default:
763 WARN_ON(1); 765 WARN_ON(1);
764 } 766 }
765 BUG_ON(ret); 767 if (ret)
768 return ret;
769
766 } 770 }
767 771
768 return ret; 772 return ret;