btrfs: prevent RCU warning when dereferencing radix tree slot
authorSasha Levin <sasha.levin@oracle.com>
Wed, 11 Jun 2014 16:00:25 +0000 (12:00 -0400)
committerChris Mason <clm@fb.com>
Fri, 13 Jun 2014 16:52:22 +0000 (09:52 -0700)
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>
fs/btrfs/tests/btrfs-tests.c

index a5dcacb5df9cc16027240549101e078c03b9220f..9626252ee6b47d2b391f3383cfa9b3bb80e4110c 100644 (file)
@@ -135,7 +135,7 @@ restart:
        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 */