]> git.baikalelectronics.ru Git - kernel.git/commit
watch_queue: Fix missing rcu annotation
authorDavid Howells <dhowells@redhat.com>
Thu, 28 Jul 2022 09:31:06 +0000 (10:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Aug 2022 10:03:43 +0000 (12:03 +0200)
commitaec3802e483f85ca3cbff93a1fe35013aa14b955
tree84e223857b589848d73b5871433f81e3d2200c0f
parent681a4ee1b8088cba0491a4e2428f7870d1547009
watch_queue: Fix missing rcu annotation

commit 45ebef626c9d270c118de7809f57b700ea38d18d upstream.

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: 175295c8c9fa ("pipe: Add general notification queue support")
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/watch_queue.c