Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2165212imm; Tue, 2 Oct 2018 22:41:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ImjjATiaH1aAxkJfWlIBgcv53+RMk4Io4EN8PonQC6wnzhv0+YEL9bwNzCYaBC8+NP+yP X-Received: by 2002:a62:3a43:: with SMTP id h64-v6mr19555130pfa.119.1538545310919; Tue, 02 Oct 2018 22:41:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538545310; cv=none; d=google.com; s=arc-20160816; b=Iu16AOb+J6b7r00MgAaAt+7/EXCLlur7OqklBmWZYisA0VCP+abaTVvW6dyJ0ZoPWP 9c1uKjYgYjPWw7QW6mJ/OPNhETt1GCjCnDV514PvrKYkmU5w0FwiFXbf/6dYsGc16YAS scsA2WAp9NdaOR1il94+i97XCBKwU5yj62HiusHJwFD9G335XkfdhI3P6MWdLurYO+HB WGVeYRoH/AW3EfBkIp8vP0GDtyui2TzR8iBTYWDrtsVI/MnVntOeknraQGRDHjiNKjt+ lWtHjq/UG6qOlX//pAcEPzNFc9MwltJnNpMZ+7rg1vA9wquDjvVjlB5eRZJ9MVHHTdI2 GSzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :reply-to:references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=a/QAGj2FNSYSE6IRPX20B0x0rP6+rCFqKkUI1OMxS2Y=; b=YhY/ep3GPntn9gEpOJ4VVI0c0wZJTfleHPalr2yLMNWoxILXZ/Mbuo142PQuhYQRXO JhU7Qfkm2KHCsTrz3fdg2I1qfQmW60rKQySn9a1YGEsm0TASTzOpOdKXMQQfX/wAg9pk tn0/lmrFPMPCyBzAH4Z10D+vxjb7dQyO4ukDfsebrdHLwtxRkNo9lw2+jl0HQNRK9Xci wW48MRpeqsRNjKik+Opv5VscIY81wv/vGTGkPowt0yESAoAIg+t4WWNK6KRQ31weZV7O wTOcJKruJBnbyfcHWC1XBQt0JpgeFNMbnP/D1gRScFuGXNv8FYfEWqLpg7f8uVkCnONp 74BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HRHAfYSf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b137-v6si374468pga.80.2018.10.02.22.41.36; Tue, 02 Oct 2018 22:41:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HRHAfYSf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727376AbeJCM05 (ORCPT + 99 others); Wed, 3 Oct 2018 08:26:57 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:40598 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727264AbeJCM05 (ORCPT ); Wed, 3 Oct 2018 08:26:57 -0400 Received: by mail-pf1-f193.google.com with SMTP id s5-v6so1102861pfj.7; Tue, 02 Oct 2018 22:40:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=a/QAGj2FNSYSE6IRPX20B0x0rP6+rCFqKkUI1OMxS2Y=; b=HRHAfYSfjNvdpluR3LOdqaDh9H70aS4T7GKdeGO8gzIRlg+GThKiGNSg11FDPNi+w2 zbMDWthlFrBOIbPC1F4Y7+G1BQODi3gM8u3GsKbfyRNsC3N++rCnN2Ds2mFPA+/ZdprB 9LIo0eGLQKMimsm4/3sFKWJiMUlWIDt4pikar9fng+VJeEnBS1KzOLBNfUQtCgfWluK1 rYy3fwuNqWv/JU56U5n+T02qcRU1plJvBhZuE609yqhVmYvVauCPQRwIC+emp60k32rc ozFBNn/VDqIhA8yvq+y7/vwdga17I4kzJuIDN8QLo1lIWZ2uCJK7xV7N9BgUnSTalbtE cXqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=a/QAGj2FNSYSE6IRPX20B0x0rP6+rCFqKkUI1OMxS2Y=; b=hN/pVcYwNYLTjZ+QOdrEiCQsuXCJFs93oPfFP8UWgFUWfWy4CnH4/h3tlA1G3apzoj PyHaScXHFBI4OHFUdsQvO/vsHFeCuJk4bmgiR9cmWzochb6g+3eO7Ri/tbANFMEAfdzR eELp9blo+nUEI8fu9rWa7e9DeGC54oB0fOyuuC5x7ExVuGHywmPL+aNU+ad7d1DuEdNQ yXvsFDR/QvJp06xzx/72rFWkMTR0dA4DoA4ajlhEfvWELl9/EuhrU+kXM+F+2zvHCGZ3 ZgTjQYczzLZgHl95FLY/WvZ1MPF7Nx3rRvSYxS9s7eS8IPmMxCw68pHrro7/5ZvrP3YL DX8A== X-Gm-Message-State: ABuFfogSYMNVsquOK0frp2x6gkw0KMamtykoY3X4WRAzvVH2aXAvee3n i7aO0DuLPlhU/NmMNXAdMb6io6fbYCg= X-Received: by 2002:a62:3995:: with SMTP id u21-v6mr19681963pfj.116.1538545207507; Tue, 02 Oct 2018 22:40:07 -0700 (PDT) Received: from E570.localdomain (c-24-21-68-121.hsd1.or.comcast.net. [24.21.68.121]) by smtp.gmail.com with ESMTPSA id s80-v6sm510208pfa.114.2018.10.02.22.40.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Oct 2018 22:40:07 -0700 (PDT) Received: by E570.localdomain (Postfix, from userid 1000) id 412021643D0; Tue, 2 Oct 2018 22:40:06 -0700 (PDT) From: Lance Roy To: linux-kernel@vger.kernel.org Cc: "Paul E. McKenney" , Lance Roy , Alexander Viro , linux-fsdevel@vger.kernel.org Subject: [PATCH 10/16] userfaultfd: Replace spin_is_locked() with lockdep Date: Tue, 2 Oct 2018 22:38:56 -0700 Message-Id: <20181003053902.6910-11-ldr709@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181003053902.6910-1-ldr709@gmail.com> References: <20181003053902.6910-1-ldr709@gmail.com> Reply-To: Lance Roy MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org lockdep_assert_held() is better suited to checking locking requirements, since it won't get confused when someone else holds the lock. This is also a step towards possibly removing spin_is_locked(). Signed-off-by: Lance Roy Cc: Alexander Viro Cc: --- fs/userfaultfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index bfa0ec69f924..a20244ff0027 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c @@ -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)) -- 2.19.0