diff options
author | Mark Fasheh <mfasheh@suse.com> | 2011-08-29 17:30:39 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2012-03-21 20:45:38 -0400 |
commit | b68dc2a93e794c8507338c91577a277efa4555d5 (patch) | |
tree | b4e8cbdafdd893a22abbbd7edca989ea018b6a72 /fs/btrfs/ctree.c | |
parent | e5df957328b18baa731307c66cfe8e7a4981df65 (diff) |
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: Mark Fasheh <mfasheh@suse.de>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r-- | fs/btrfs/ctree.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 3b767d2b68e8..36e16bd50798 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c | |||
@@ -474,7 +474,10 @@ static noinline int __btrfs_cow_block(struct btrfs_trans_handle *trans, | |||
474 | BTRFS_FSID_SIZE); | 474 | BTRFS_FSID_SIZE); |
475 | 475 | ||
476 | ret = update_ref_for_cow(trans, root, buf, cow, &last_ref); | 476 | ret = update_ref_for_cow(trans, root, buf, cow, &last_ref); |
477 | BUG_ON(ret); | 477 | if (ret) { |
478 | btrfs_std_error(root->fs_info, ret); | ||
479 | return ret; | ||
480 | } | ||
478 | 481 | ||
479 | if (root->ref_cows) | 482 | if (root->ref_cows) |
480 | btrfs_reloc_cow_block(trans, root, buf, cow); | 483 | btrfs_reloc_cow_block(trans, root, buf, cow); |