btrfs-progs: fsck: Avoid abort and BUG_ON in add_tree_backref
commit9a0f2f1e53e4620b21680f64c263b3cbbcd8d512
authorQu Wenruo <quwenruo@cn.fujitsu.com>
Tue, 30 Aug 2016 07:22:16 +0000 (30 15:22 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Sep 2016 08:05:01 +0000 (5 10:05 +0200)
treef171dc8c388afda98d45182c75a51b6b217092dc
parent77deae9cb712e543dc7a8cbd4d80ca219f798084
btrfs-progs: fsck: Avoid abort and BUG_ON in add_tree_backref

Add_tree_backref() can cause BUG_ON() and abort() in quite a lot of
cases, from the ENOMEM to existing tree backref records.

Change all these BUG_ON() and abort() to return proper values.
And modify all callers to handle such problems.

Reported-by: Lukas Lueg <lukas.lueg@gmail.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-check.c