Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp641682ybv; Thu, 13 Feb 2020 07:04:07 -0800 (PST) X-Google-Smtp-Source: APXvYqx95/cpJzWLLpFXx1WKzYECgLGohmmOF1ZeA3BAerZ2GFNaOkcR11zKY6BKh18AXdZmiJb/ X-Received: by 2002:a05:6830:1691:: with SMTP id k17mr14155939otr.282.1581606247212; Thu, 13 Feb 2020 07:04:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581606247; cv=none; d=google.com; s=arc-20160816; b=l17OO/opfv375wBatHgWVzeh7oqpPZlh+yzWln3WPqVoKATO1jJhKBcALbj+4S4v3A /cZg5tWelFnDJRyomEHeY28PNd56mGW1wpRgTtpPsh6SZ5DkrhoTdGLoNhHKSiXPomzV TACEAxglFn74HdYZ6o7PhueG+VVx/ekSVlMmqQVWKE/jFTiWiT3/DnnL+lkLaJFY2OVY 4KYohX6pv8qMeL9KIyav0rmKgfbImBS9vFsgJvz0vVAye3sViTjQ4MtJv38XdZefmU8+ k+2kgEk1svs0/bBbctarC7pBnAQa09xvbmGX9PNOnT7tdUUioVjyi9MjsAS02UTiX7mJ zyzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=G1URVlj7Itamof72U88sCTyKrE2tsgoZIU1g2MQTLT4=; b=zMMPeqwk2uAOBn8Q10M0sWr7fAXXWXmVoB447TtKtGhSUyKWPZwXhl9Wm8fmw57F9j QyHfjpY49mxPx8nE5HVbMYJWjEg4j9LHcYQMiOVgsU1sHxREu/vCKQlPTAmj4eCQV63O 5znagJfZmXdIAm6PWLYLTBQPpu1iYQq8kiFKpcRMDLA+XuThYL+XV9vHFSJaZL3fOpA0 tYmN37KKDmQN6kKu+orVg0Utda+tzuH07V7Sc+cPhMqgBtfgztrI3gfr6/sOVWgho6sr 3FXmXI25hNQrDs+yGD7VLFmqw69CaPvJWacVBu+tGDGi7YBulxJwUih53ygpbyubB5aj YjXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eEunzPMS; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 i6si1318630otp.5.2020.02.13.07.03.52; Thu, 13 Feb 2020 07:04:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-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=eEunzPMS; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-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 S1727436AbgBMPDv (ORCPT + 99 others); Thu, 13 Feb 2020 10:03:51 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46772 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727433AbgBMPDv (ORCPT ); Thu, 13 Feb 2020 10:03:51 -0500 Received: by mail-pf1-f193.google.com with SMTP id k29so3190454pfp.13; Thu, 13 Feb 2020 07:03:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=G1URVlj7Itamof72U88sCTyKrE2tsgoZIU1g2MQTLT4=; b=eEunzPMSbxFG4bweZ0Ndj/87P833Ic9MFPnCSzj55NPcR0ymQ82wsiZqYSb1nk4y8n vnpDpP/RPoawFH2lKT+fH4LIqVcY3vw+XZ6VCFYWIxChO/zfnraDY1s+K2Vu8WxYmGaf p6kt/jZUcpj6P7ZpJdtxdBMtpgOT126Vr4mY5DboJ08lKnkcs7yEah2L6qRnLy2HAFmn pSdCkkgmCIlMOHbVYd62VqCTkmnmn1rTPlIW36YpxbBZMLjgQ2Wqpvfx1S8tGhno5wx4 UsaeR6bH6DWuuSJJfZxvFgJ53tyZO1tbQs3rnpCGEKCKyJ36BSJBdlZtxA4O0oLBVawd /bpg== 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; bh=G1URVlj7Itamof72U88sCTyKrE2tsgoZIU1g2MQTLT4=; b=mqQ96r49+noN21pbjWWxswiEzHKtRJyhb0y7WXcriuIhDlDQjPGP7l8KXLnxqWsuX/ hTG6nJpiHwTMPYFBrRtLzj8GfdLef+d2H4UzxqrSGQs9aa6jFb7RCIkPCmaVVsJEfVwc +V36GJRr55qvX7DXMKLpW6F5Pf0kVFO5wz1Yiu0nBKi0eI6gl76oeukixY3cN1z9RIor JUCOK7PcrHzXXJ01Rmkmk4Z9z/T744D5zV4U09xCNWpU1EAiIM5Hvb8cL6LGSSvNX2GU kgHVyIBU6bAIjOZW+jKECNLF2j5mrkNx16QDjYfteFK1kCh4dxOnWKzuOi4Ah5tTJfKb +uUA== X-Gm-Message-State: APjAAAWOOzcYTNx/pSAG64x9PtcsrNUp9sV52Aa4dgD88Yg6LgztmmrL PoKZJbsvpJ1AQpnV1wGD/w== X-Received: by 2002:a65:4c82:: with SMTP id m2mr17868613pgt.432.1581606229256; Thu, 13 Feb 2020 07:03:49 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee8:f65a:fc5b:5bfd:1ab4:4848]) by smtp.gmail.com with ESMTPSA id 11sm3625726pfz.25.2020.02.13.07.03.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 07:03:48 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: bfields@fieldses.org, chuck.lever@oracle.com Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, paulmck@kernel.org, Madhuparna Bhowmik Subject: [PATCH] fs: nfsd: nfs4state.c: Use built-in RCU list checking Date: Thu, 13 Feb 2020 20:33:31 +0530 Message-Id: <20200213150331.5727-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Madhuparna Bhowmik list_for_each_entry_rcu() has built-in RCU and lock checking. Pass cond argument to list_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled by default. Signed-off-by: Madhuparna Bhowmik --- fs/nfsd/nfs4state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 369e574c5092..3a80721fe53d 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4295,7 +4295,8 @@ find_file_locked(struct knfsd_fh *fh, unsigned int hashval) { struct nfs4_file *fp; - hlist_for_each_entry_rcu(fp, &file_hashtbl[hashval], fi_hash) { + hlist_for_each_entry_rcu(fp, &file_hashtbl[hashval], fi_hash, + lockdep_is_held(&state_lock)) { if (fh_match(&fp->fi_fhandle, fh)) { if (refcount_inc_not_zero(&fp->fi_ref)) return fp; -- 2.17.1