Skip to content

Commit e0339f0

Browse files
dhowellstorvalds
authored andcommitted
watch_queue: Fix missing rcu annotation
Since __post_watch_notification() walks wlist->watchers with only the RCU read lock held, we need to use RCU methods to add to the list (we already use RCU methods to remove from the list). Fix add_watch_to_object() to use hlist_add_head_rcu() instead of hlist_add_head() for that list. Fixes: c73be61 ("pipe: Add general notification queue support") Signed-off-by: David Howells <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 6e7765c commit e0339f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/watch_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ int add_watch_to_object(struct watch *watch, struct watch_list *wlist)
494494
unlock_wqueue(wqueue);
495495
}
496496

497-
hlist_add_head(&watch->list_node, &wlist->watchers);
497+
hlist_add_head_rcu(&watch->list_node, &wlist->watchers);
498498
return 0;
499499
}
500500
EXPORT_SYMBOL(add_watch_to_object);

0 commit comments

Comments
 (0)