Skip to content

Commit

Permalink
btrfs: prevent RCU warning when dereferencing radix tree slot
Browse files Browse the repository at this point in the history
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 <sasha.levin@oracle.com>
Signed-off-by: Chris Mason <clm@fb.com>
  • Loading branch information
sashalevin authored and masoncl committed Jun 13, 2014
1 parent 5fbc7c5 commit f1e3c28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/tests/btrfs-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static void btrfs_free_dummy_fs_info(struct btrfs_fs_info *fs_info)
radix_tree_for_each_slot(slot, &fs_info->buffer_radix, &iter, 0) {
struct extent_buffer *eb;

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

0 comments on commit f1e3c28

Please sign in to comment.