aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/extent-tree.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index ff3f7c2be60..b074ad1416d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -244,7 +244,7 @@ struct btrfs_block_group_cache *btrfs_find_block_group(struct btrfs_root *root,
244 if (search_start) { 244 if (search_start) {
245 struct btrfs_block_group_cache *shint; 245 struct btrfs_block_group_cache *shint;
246 shint = btrfs_lookup_block_group(info, search_start); 246 shint = btrfs_lookup_block_group(info, search_start);
247 if (shint->data == data) { 247 if (shint && shint->data == data) {
248 used = btrfs_block_group_used(&shint->item); 248 used = btrfs_block_group_used(&shint->item);
249 if (used + shint->pinned < 249 if (used + shint->pinned <
250 div_factor(shint->key.offset, factor)) { 250 div_factor(shint->key.offset, factor)) {
@@ -1255,8 +1255,7 @@ struct buffer_head *btrfs_alloc_free_block(struct btrfs_trans_handle *trans,
1255 struct buffer_head *buf; 1255 struct buffer_head *buf;
1256 1256
1257 ret = btrfs_alloc_extent(trans, root, root->root_key.objectid, 1257 ret = btrfs_alloc_extent(trans, root, root->root_key.objectid,
1258 1, empty_size, hint, 1258 1, empty_size, hint, (u64)-1, &ins, 0);
1259 (unsigned long)-1, &ins, 0);
1260 if (ret) { 1259 if (ret) {
1261 BUG_ON(ret > 0); 1260 BUG_ON(ret > 0);
1262 return ERR_PTR(ret); 1261 return ERR_PTR(ret);