diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index ba0fee7c3237d17c0e5b82df38bca06f04272445..66f44c7534d0e869efdf71d558d277be3a42d15e 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, default: WARN_ON(1); } - BUG_ON(ret); + if (ret) + return ret; } return 0; @@ -680,7 +681,8 @@ static int __add_inline_refs(struct btrfs_fs_info *fs_info, default: WARN_ON(1); } - BUG_ON(ret); + if (ret) + return ret; ptr += btrfs_extent_inline_ref_size(type); } @@ -762,7 +764,9 @@ static int __add_keyed_refs(struct btrfs_fs_info *fs_info, default: WARN_ON(1); } - BUG_ON(ret); + if (ret) + return ret; + } return ret;