public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: 黄乐 <huangle1@jd.com>
To: "bfields@fieldses.org" <bfields@fieldses.org>
Cc: "jlayton@kernel.org" <jlayton@kernel.org>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nfsd4: fix a deadlock on state owner replay mutex
Date: Wed, 10 Jul 2019 18:43:20 +0000	[thread overview]
Message-ID: <4dd1fe21e11344e5969bb112e954affb@jd.com> (raw)
In-Reply-To: <20190710000300.GD1536@fieldses.org>

It's safe because when we reach move_to_close_lru(), we know we are the
*logical* last call among all racing calls, it is actually the reason we
do the waiting here at fist place.  Now just because of racing, we gain
the rp_mutex first and have a *lower* seqid value, so it is what we need
exactly to let the seqid bump with other racing calls before we continue,
that ensures possible future CLOSE call could be replayed correctly.


On Wed, Jul 10, 2019, bfields@fieldses.org wrote:
> I don't understand why that's safe.  Maybe it is, but I don't understand
> yet.  If we take the mutex, bump the seqid, drop the mutex, someone else
> comes in and bumps the seqid again, then we reacquire the mutex... what
> happens?
> 
> --b.

  reply	other threads:[~2019-07-10 18:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 18:30 [PATCH] nfsd4: fix a deadlock on state owner replay mutex 黄乐
2019-07-10  0:03 ` bfields
2019-07-10 18:43   ` 黄乐 [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-06-27 18:16 黄乐

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=4dd1fe21e11344e5969bb112e954affb@jd.com \
    --to=huangle1@jd.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    /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