Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 253088
b: refs/heads/master
c: 207dde8
h: refs/heads/master
v: v3
  • Loading branch information
Josef Bacik committed May 23, 2011
1 parent 7e22695 commit 68da36c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 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: cca1c81f43e26ab60c0d1090fb90992358d69bdf
refs/heads/master: 207dde8289d9b005b665cb9d8d2bb9464256101d
27 changes: 24 additions & 3 deletions trunk/fs/btrfs/free-space-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,14 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
spin_lock(&block_group->tree_lock);
ret = link_free_space(block_group, e);
spin_unlock(&block_group->tree_lock);
BUG_ON(ret);
if (ret) {
printk(KERN_ERR "Duplicate entries in "
"free space cache, dumping\n");
kunmap(page);
unlock_page(page);
page_cache_release(page);
goto free_cache;
}
} else {
e->bitmap = kzalloc(PAGE_CACHE_SIZE, GFP_NOFS);
if (!e->bitmap) {
Expand All @@ -437,6 +444,14 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
recalculate_thresholds(block_group);
spin_unlock(&block_group->tree_lock);
list_add_tail(&e->list, &bitmaps);
if (ret) {
printk(KERN_ERR "Duplicate entries in "
"free space cache, dumping\n");
kunmap(page);
unlock_page(page);
page_cache_release(page);
goto free_cache;
}
}

num_entries--;
Expand Down Expand Up @@ -909,10 +924,16 @@ static int tree_insert_offset(struct rb_root *root, u64 offset,
* logically.
*/
if (bitmap) {
WARN_ON(info->bitmap);
if (info->bitmap) {
WARN_ON_ONCE(1);
return -EEXIST;
}
p = &(*p)->rb_right;
} else {
WARN_ON(!info->bitmap);
if (!info->bitmap) {
WARN_ON_ONCE(1);
return -EEXIST;
}
p = &(*p)->rb_left;
}
}
Expand Down

0 comments on commit 68da36c

Please sign in to comment.