Skip to contentSkip to conversation

btrfs: prevent RCU warning when dereferencing radix tree slot

PATCH New Sasha Levin 1 participant 1 message Jun 11, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 fs/btrfs/tests/btrfs-tests.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/tests/btrfs-tests.c +1 -1
index a5dcacb..9626252 100644
@@ -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 */
Signature · 1 line
1.7.10.4