summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index e7192ea8f96..9eb2ee02f64 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -714,7 +714,7 @@ static int pin_down_bytes(struct btrfs_root *root, u64 bytenr, u32 num_bytes,
root->fs_info->running_transaction->transid;
if (btrfs_header_generation(buf) == transid) {
free_extent_buffer(buf);
- return 0;
+ return 1;
}
}
free_extent_buffer(buf);
@@ -774,7 +774,9 @@ static int __free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
if (pin) {
ret = pin_down_bytes(root, bytenr, num_bytes, 0);
- BUG_ON(ret);
+ if (ret > 0)
+ mark_free = 1;
+ BUG_ON(ret < 0);
}
/* block accounting for super block */