]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: Don't BUG_ON() errors in update_ref_for_cow()
authorMark Fasheh <mfasheh@suse.com>
Mon, 8 Aug 2011 20:20:18 +0000 (13:20 -0700)
committerDavid Sterba <dsterba@suse.cz>
Thu, 22 Mar 2012 00:45:36 +0000 (01:45 +0100)
commit8d3d7c68f882518861fbc8de4581d7e28bd564e1
treede88d181ecbdcb130343116d7a6f71bbbc4a7e1a
parent43ec727615f5c52b02303b82aeb84a1e18f3d8bc
btrfs: Don't BUG_ON() errors in update_ref_for_cow()

The only caller of update_ref_for_cow() is __btrfs_cow_block() which was
originally ignoring any return values. update_ref_for_cow() however doesn't
look like a candidate to become a void function - there are a few places
where errors can occur.

So instead I changed update_ref_for_cow() to bubble all errors up (instead
of BUG_ON). __btrfs_cow_block() was then updated to catch and BUG_ON() any
errors from update_ref_for_cow(). The end effect is that we have no change
in behavior, but about 8 different places where a BUG_ON(ret) was removed.

Obviously a future patch will have to address the BUG_ON() in
__btrfs_cow_block().

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
fs/btrfs/ctree.c