Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3602948ybf; Tue, 3 Mar 2020 08:55:04 -0800 (PST) X-Google-Smtp-Source: ADFU+vvbObdrisC+c1aHYnfdkteMvVzJKuSZFTL0rYIXOwWOpKw2jr25y6Z+WAb6BWlGrO8bt6I1 X-Received: by 2002:a9d:138:: with SMTP id 53mr1783326otu.67.1583254504225; Tue, 03 Mar 2020 08:55:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583254504; cv=none; d=google.com; s=arc-20160816; b=kb15O6GlfdgPh90x00zk7fusVINzgeJXl0yY4hZm8k+OR40vZfCTWgW27PQ+bEnV0B m0lOEDnCO98L62C+JCchWRc7ZPUsx41WwEOSgpA7A0/r8HwEW8iKwF1kw4PwHPuBkI/a AMzoYbYVNL1eLO9/y4uws1TpgoJBNDjZ4fvyIkcVwFag7S3eZcRiIYHKY2hdRkY9uM8D Soqerr/kTHSH3HnySTQQyWi2EeVQZALEEc0/KF0uAV+sBNnj1BjtcMWbEKZnBlEOvkr2 XNrLQaYxYJbbgq7AI+C7UeVkmf4n1BwBkIdYZhs7tCyTOaEygsCMR3V3767W+YNzXMWV o8vA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Kao5IITUKFkSuMzvHeHeFdJLf7lbjkBQppqHLhRxCns=; b=bjaegaun5fKkvyzgtDa08HnEl7PkYG4Bpa6NBw4Comy3XUluJk8o+UE7GjnR1pgsVU RL9JXU8ftUyqhd2WMIPMhrkdSdvU2yd8X5w5g0xITfXKNYPD5L8cipVARN/mjkdeM1BG wJV80UgpwLYlncUDXfaiM/vitU8ZNlnFRS7vWmjM051PEH6sHIBoI0gaiTbfsh+2ZESp m5QUtKpRQoiJ4PO27rH7FN/Kvv3gvbocu463ekRD2zTi2iAhtCxxq86vTFwWRD8H2cxI PyvDvsLbYdvqtnYTn2RM9JGQZD70gCm35J9hA5AOitJyIXOTEj3sXp4SW/xbsx0txDn9 8sug== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si8141697otr.255.2020.03.03.08.54.41; Tue, 03 Mar 2020 08:55:04 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727311AbgCCQyj (ORCPT + 99 others); Tue, 3 Mar 2020 11:54:39 -0500 Received: from fieldses.org ([173.255.197.46]:37338 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727070AbgCCQyj (ORCPT ); Tue, 3 Mar 2020 11:54:39 -0500 Received: by fieldses.org (Postfix, from userid 2815) id 1B27D1C22; Tue, 3 Mar 2020 11:54:39 -0500 (EST) Date: Tue, 3 Mar 2020 11:54:39 -0500 From: "J. Bruce Fields" To: madhuparnabhowmik10@gmail.com Cc: chuck.lever@oracle.com, 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 Subject: Re: [PATCH] fs: nfsd: nfs4state.c: Use built-in RCU list checking Message-ID: <20200303165439.GC19140@fieldses.org> References: <20200213150331.5727-1-madhuparnabhowmik10@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200213150331.5727-1-madhuparnabhowmik10@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Applying for 5.7, thanks.--b. On Thu, Feb 13, 2020 at 08:33:31PM +0530, madhuparnabhowmik10@gmail.com wrote: > 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