userfaultfd: Replace spin_is_locked() with lockdep
authorLance Roy <ldr709@gmail.com>
Fri, 5 Oct 2018 06:45:44 +0000 (23:45 -0700)
committerPaul E. McKenney <paulmck@linux.ibm.com>
Mon, 12 Nov 2018 17:06:22 +0000 (09:06 -0800)
lockdep_assert_held() is better suited to checking locking requirements,
since it only checks if the current thread holds the lock regardless of
whether someone else does. This is also a step towards possibly removing
spin_is_locked().

Signed-off-by: Lance Roy <ldr709@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: <linux-fsdevel@vger.kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>
fs/userfaultfd.c

index 356d2b8568c1424d1d1935c451e65c7db13aab62..681881dc8a9d04d99fab20a8d75a4c58730ca715 100644 (file)
@@ -926,7 +926,7 @@ static inline struct userfaultfd_wait_queue *find_userfault_in(
        wait_queue_entry_t *wq;
        struct userfaultfd_wait_queue *uwq;
 
-       VM_BUG_ON(!spin_is_locked(&wqh->lock));
+       lockdep_assert_held(&wqh->lock);
 
        uwq = NULL;
        if (!waitqueue_active(wqh))