Skip to content

Commit f1e3c28

Browse files
sashalevinmasoncl
authored andcommitted
btrfs: prevent RCU warning when dereferencing radix tree slot
Mark the dereference as protected by lock. Not doing so triggers an RCU warning since the radix tree assumed that RCU is in use. Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Chris Mason <[email protected]>
1 parent 5fbc7c5 commit f1e3c28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/btrfs/tests/btrfs-tests.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
135135
radix_tree_for_each_slot(slot, &fs_info->buffer_radix, &iter, 0) {
136136
struct extent_buffer *eb;
137137

138-
eb = radix_tree_deref_slot(slot);
138+
eb = radix_tree_deref_slot_protected(slot, &fs_info->buffer_lock);
139139
if (!eb)
140140
continue;
141141
/* Shouldn't happen but that kind of thinking creates CVE's */

0 commit comments

Comments
 (0)