From patchwork Wed Oct 3 05:38:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Roy X-Patchwork-Id: 10624321 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABCF015A7 for ; Wed, 3 Oct 2018 05:41:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B68C28563 for ; Wed, 3 Oct 2018 05:41:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D35A285FD; Wed, 3 Oct 2018 05:41:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3031F28563 for ; Wed, 3 Oct 2018 05:41:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727368AbeJCM05 (ORCPT ); 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-Google-Smtp-Source: ACcGV60tXU4wa7/gMSCwbhVLZ7BY29d7TyIFfXycmRA1zDEzbNaaMGmGIIu8cjVS9yDjvKA5fu1d3Q== 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 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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))