Skip to content

Commit

Permalink
Btrfs: remove some BUG_ONs() when walking backref tree
Browse files Browse the repository at this point in the history
The only error return value of __add_prelim_ref() is -ENOMEM,
just return errors rather than trigger BUG_ON().

Signed-off-by: Wang Shilong <wangsl-fnst@cn.fujitsu.com>
Reviewed-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
  • Loading branch information
Wang Shilong authored and Josef Bacik committed May 6, 2013
1 parent 92f183a commit 1149ab6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 1149ab6

Please sign in to comment.