linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J . Bruce Fields" <bfields@fieldses.org>
To: Amol Grover <frextrite@gmail.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
	Anna Schumaker <anna.schumaker@netapp.com>,
	Chuck Lever <chuck.lever@oracle.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Joel Fernandes <joel@joelfernandes.org>,
	Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	linux-nfs@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] sunrpc: Pass lockdep expression to RCU lists
Date: Tue, 3 Mar 2020 11:37:34 -0500	[thread overview]
Message-ID: <20200303163734.GA19140@fieldses.org> (raw)
In-Reply-To: <20200219093504.16290-1-frextrite@gmail.com>

On Wed, Feb 19, 2020 at 03:05:05PM +0530, Amol Grover wrote:
> detail->hash_table[] is traversed using hlist_for_each_entry_rcu
> outside an RCU read-side critical section but under the protection
> of detail->hash_lock.
> 
> Hence, add corresponding lockdep expression to silence false-positive
> warnings, and harden RCU lists.

Thanks, applying for 5.7.--b.

> 
> Signed-off-by: Amol Grover <frextrite@gmail.com>
> ---
>  net/sunrpc/cache.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> index f740cb51802a..5db5f5b94726 100644
> --- a/net/sunrpc/cache.c
> +++ b/net/sunrpc/cache.c
> @@ -97,7 +97,8 @@ static struct cache_head *sunrpc_cache_add_entry(struct cache_detail *detail,
>  	spin_lock(&detail->hash_lock);
>  
>  	/* check if entry appeared while we slept */
> -	hlist_for_each_entry_rcu(tmp, head, cache_list) {
> +	hlist_for_each_entry_rcu(tmp, head, cache_list,
> +				 lockdep_is_held(&detail->hash_lock)) {
>  		if (detail->match(tmp, key)) {
>  			if (cache_is_expired(detail, tmp)) {
>  				hlist_del_init_rcu(&tmp->cache_list);
> -- 
> 2.24.1

      reply	other threads:[~2020-03-03 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-19  9:35 [PATCH] sunrpc: Pass lockdep expression to RCU lists Amol Grover
2020-03-03 16:37 ` J . Bruce Fields [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200303163734.GA19140@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=anna.schumaker@netapp.com \
    --cc=chuck.lever@oracle.com \
    --cc=davem@davemloft.net \
    --cc=frextrite@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=madhuparnabhowmik10@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=trond.myklebust@hammerspace.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).