Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1531591 > unrolled thread

[PATCH v3 19/33] btrfs: Fix race in btrfs_free_dummy_fs_info()

Started byMatthew Wilcox <mawilcox@linuxonhyperv.com>
First post2016-11-28 21:10 +0100
Last post2016-11-28 21:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v3 19/33] btrfs: Fix race in btrfs_free_dummy_fs_info() Matthew Wilcox <mawilcox@linuxonhyperv.com> - 2016-11-28 21:10 +0100

#1531591 — [PATCH v3 19/33] btrfs: Fix race in btrfs_free_dummy_fs_info()

FromMatthew Wilcox <mawilcox@linuxonhyperv.com>
Date2016-11-28 21:10 +0100
Subject[PATCH v3 19/33] btrfs: Fix race in btrfs_free_dummy_fs_info()
Message-ID<sIAps-6LC-11@gated-at.bofh.it>
From: Matthew Wilcox <mawilcox@microsoft.com>

We drop the lock which protects the radix tree, so we must call
radix_tree_iter_next() in order to avoid a modification to the tree
invalidating the iterator state.

Signed-off-by: Matthew Wilcox <mawilcox@microsoft.com>
---
 fs/btrfs/tests/btrfs-tests.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/tests/btrfs-tests.c b/fs/btrfs/tests/btrfs-tests.c
index bf62ad9..73076a0 100644
--- a/fs/btrfs/tests/btrfs-tests.c
+++ b/fs/btrfs/tests/btrfs-tests.c
@@ -162,6 +162,7 @@ void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
 				slot = radix_tree_iter_retry(&iter);
 			continue;
 		}
+		slot = radix_tree_iter_next(&iter);
 		spin_unlock(&fs_info->buffer_lock);
 		free_extent_buffer_stale(eb);
 		spin_lock(&fs_info->buffer_lock);
-- 
2.10.2

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web