Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360419
b: refs/heads/master
c: 0f5d42b
h: refs/heads/master
i:
  360417: 58e9a20
  360415: 214ebbc
v: v3
  • Loading branch information
Josef Bacik committed Feb 20, 2013
1 parent d924519 commit 1aaa80b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0448748849ef7c593be40e2c1404f7974bd3aac6
refs/heads/master: 0f5d42b287f32417e54485d79f2318cf2970b37d
14 changes: 12 additions & 2 deletions trunk/fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -3821,9 +3821,10 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
write_lock(&em_tree->lock);
ret = add_extent_mapping(em_tree, em);
write_unlock(&em_tree->lock);
free_extent_map(em);
if (ret)
if (ret) {
free_extent_map(em);
goto error;
}

for (i = 0; i < map->num_stripes; ++i) {
struct btrfs_device *device;
Expand All @@ -3848,6 +3849,7 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
goto error_dev_extent;
}

free_extent_map(em);
kfree(devices_info);
return 0;

Expand All @@ -3863,6 +3865,14 @@ static int __btrfs_alloc_chunk(struct btrfs_trans_handle *trans,
break;
}
}
write_lock(&em_tree->lock);
remove_extent_mapping(em_tree, em);
write_unlock(&em_tree->lock);

/* One for our allocation */
free_extent_map(em);
/* One for the tree reference */
free_extent_map(em);
error:
kfree(map);
kfree(devices_info);
Expand Down

0 comments on commit 1aaa80b

Please sign in to comment.