Skip to content

Commit

Permalink
btrfs: Don't BUG_ON errors from update_ref_for_cow()
Browse files Browse the repository at this point in the history
__btrfs_cow_block(), the only caller of update_ref_for_cow() will BUG_ON()
any error return.  Instead, we can go read-only fs as update_ref_for_cow()
manipulates disk data in a way which doesn't look like it's easily rolled
back.

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
  • Loading branch information
Mark Fasheh authored and David Sterba committed Mar 22, 2012
1 parent e5df957 commit b68dc2a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fs/btrfs/ctree.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,10 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
BTRFS_FSID_SIZE);

ret = update_ref_for_cow(trans, root, buf, cow, &last_ref);
BUG_ON(ret);
if (ret) {
btrfs_std_error(root->fs_info, ret);
return ret;
}

if (root->ref_cows)
btrfs_reloc_cow_block(trans, root, buf, cow);
Expand Down

0 comments on commit b68dc2a

Please sign in to comment.