]> www.infradead.org Git - users/jedix/linux-maple.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)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Wed, 14 Nov 2012 16:24:36 +0000 (08:24 -0800)
commite94fee68d61423af7582f49931b7f4fceb69d982
tree7edbd5570917c46afaab7b096ce05b6ef8c536e4
parentbfa9df4fc71a310a5c4fa9b695414c8ed0ead039
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>
(cherry picked from commit be1a5564fd39fa2ca6adbb41c75fb08f96a1ffcb)

Conflicts:

fs/btrfs/ctree.c

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
fs/btrfs/ctree.c