From: Christoph Hellwig Date: Wed, 22 Aug 2018 04:56:34 +0000 (-0700) Subject: sched/wait: assert the wait_queue_head lock is held in __wake_up_common X-Git-Tag: v4.19-rc1~59^2~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e05a8e4d88d16e088d83ce679ac3343ac66c936b;p=thirdparty%2Fkernel%2Flinux.git sched/wait: assert the wait_queue_head lock is held in __wake_up_common Better ensure we actually hold the lock using lockdep than just commenting on it. Due to the various exported _locked interfaces it is far too easy to get the locking wrong. Link: http://lkml.kernel.org/r/20171214152344.6880-4-hch@lst.de Signed-off-by: Christoph Hellwig Acked-by: Ingo Molnar Cc: Al Viro Cc: Andrea Arcangeli Cc: Ingo Molnar Cc: Jason Baron Cc: Matthew Wilcox Cc: Mike Rapoport Cc: Peter Zijlstra Cc: Davidlohr Bueso Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/sched/wait.c b/kernel/sched/wait.c index 870f97b313e38..5dd47f1103d18 100644 --- a/kernel/sched/wait.c +++ b/kernel/sched/wait.c @@ -69,6 +69,8 @@ static int __wake_up_common(struct wait_queue_head *wq_head, unsigned int mode, wait_queue_entry_t *curr, *next; int cnt = 0; + lockdep_assert_held(&wq_head->lock); + if (bookmark && (bookmark->flags & WQ_FLAG_BOOKMARK)) { curr = list_next_entry(bookmark, entry);