Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297845
b: refs/heads/master
c: 115391d
h: refs/heads/master
i:
  297843: d693a44
v: v3
  • Loading branch information
Josef Bacik authored and Chris Mason committed Mar 26, 2012
1 parent 40bccf1 commit 5981929
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 4f2de97acee6532b36dd6e995b858343771ad126
refs/heads/master: 115391d2315239164e400a8259b26392afccf3bd
10 changes: 8 additions & 2 deletions trunk/fs/btrfs/extent_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -3750,7 +3750,7 @@ struct extent_buffer *alloc_extent_buffer(struct extent_io_tree *tree,
}
if (uptodate)
set_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);

again:
ret = radix_tree_preload(GFP_NOFS & ~__GFP_HIGHMEM);
if (ret)
goto free_eb;
Expand All @@ -3760,7 +3760,13 @@ struct extent_buffer *alloc_extent_buffer(struct extent_io_tree *tree,
if (ret == -EEXIST) {
exists = radix_tree_lookup(&tree->buffer,
start >> PAGE_CACHE_SHIFT);
atomic_inc(&exists->refs);
if (!atomic_inc_not_zero(&exists->refs)) {
spin_unlock(&tree->buffer_lock);
radix_tree_preload_end();
synchronize_rcu();
exists = NULL;
goto again;
}
spin_unlock(&tree->buffer_lock);
radix_tree_preload_end();
goto free_eb;
Expand Down

0 comments on commit 5981929

Please sign in to comment.