btrfs: use radix_tree_iter_retry()
authorMatthew Wilcox <willy@linux.intel.com>
Thu, 17 Mar 2016 21:22:00 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Mar 2016 22:09:34 +0000 (15:09 -0700)
Even though this is a 'can't happen' situation, use the new
radix_tree_iter_retry() pattern to eliminate a goto.

[akpm@linux-foundation.org: fix btrfs build]
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <jbacik@fb.com>
Cc: David Sterba <dsterba@suse.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/btrfs/tests/btrfs-tests.c

index 0e1e61a..1c76d73 100644 (file)
@@ -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;
 
@@ -147,7 +146,7 @@ restart:
                /* 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);