Commit b68dc2a9 authored by Mark Fasheh's avatar Mark Fasheh Committed by David Sterba

btrfs: Don't BUG_ON errors from update_ref_for_cow()

__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: default avatarMark Fasheh <mfasheh@suse.de>
parent e5df9573
...@@ -474,7 +474,10 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, ...@@ -474,7 +474,10 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans,
BTRFS_FSID_SIZE); BTRFS_FSID_SIZE);
ret = update_ref_for_cow(trans, root, buf, cow, &last_ref); 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) if (root->ref_cows)
btrfs_reloc_cow_block(trans, root, buf, cow); btrfs_reloc_cow_block(trans, root, buf, cow);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment