Skip to content

Commit

Permalink
btrfs: use radix_tree_iter_retry()
Browse files Browse the repository at this point in the history
Even though this is a 'can't happen' situation, use the new
radix_tree_iter_retry() pattern to eliminate a goto.

[[email protected]: fix btrfs build]
Signed-off-by: Matthew Wilcox <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Konstantin Khlebnikov <[email protected]>
Cc: Chris Mason <[email protected]>
Cc: Josef Bacik <[email protected]>
Cc: David Sterba <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Matthew Wilcox authored and torvalds committed Mar 17, 2016
1 parent 7cf19af commit c28f242
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/tests/btrfs-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ static void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
void **slot;

spin_lock(&fs_info->buffer_lock);
restart:
radix_tree_for_each_slot(slot, &fs_info->buffer_radix, &iter, 0) {
struct extent_buffer *eb;

Expand All @@ -147,7 +146,7 @@ static void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
/* Shouldn't happen but that kind of thinking creates CVE's */
if (radix_tree_exception(eb)) {
if (radix_tree_deref_retry(eb))
goto restart;
slot = radix_tree_iter_retry(&iter);
continue;
}
spin_unlock(&fs_info->buffer_lock);
Expand Down

0 comments on commit c28f242

Please sign in to comment.