aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-04-24 16:38:50 -0400
committerJosef Bacik <jbacik@fusionio.com>2013-05-06 15:55:09 -0400
commit32b0253803bf8e384a37a70f2dfffb2056e7d087 (patch)
treeee17b31fdbb07bf94aea26a62d8099a396f5202a /fs/btrfs
parent171f6537abb1929ab9072ed084872273300ca175 (diff)
Btrfs: don't panic if we're trying to drop too many refs
This is just obnoxious. Just print a message, abort the transaction, and return an error. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 6526f1faf6c2..f8a5652b0c43 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -5596,7 +5596,13 @@ static int __btrfs_free_extent(struct btrfs_trans_handle *trans,
5596 } 5596 }
5597 5597
5598 refs = btrfs_extent_refs(leaf, ei); 5598 refs = btrfs_extent_refs(leaf, ei);
5599 BUG_ON(refs < refs_to_drop); 5599 if (refs < refs_to_drop) {
5600 btrfs_err(info, "trying to drop %d refs but we only have %Lu "
5601 "for bytenr %Lu\n", refs_to_drop, refs, bytenr);
5602 ret = -EINVAL;
5603 btrfs_abort_transaction(trans, extent_root, ret);
5604 goto out;
5605 }
5600 refs -= refs_to_drop; 5606 refs -= refs_to_drop;
5601 5607
5602 if (refs > 0) { 5608 if (refs > 0) {