From: Jeff Layton <jlayton@poochiereds.net>
To: Christoph Hellwig <hch@lst.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
Kinglong Mee <kinglongmee@gmail.com>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH RFC] nfsd: serialize layout stateid morphing operations
Date: Mon, 7 Dec 2015 08:28:03 -0500 [thread overview]
Message-ID: <20151207082803.0b160bb6@tlielax.poochiereds.net> (raw)
In-Reply-To: <20151207130932.GB30843@lst.de>
On Mon, 7 Dec 2015 14:09:32 +0100
Christoph Hellwig <hch@lst.de> wrote:
> On Sun, Dec 06, 2015 at 08:09:54AM -0500, Jeff Layton wrote:
> > Either way...in the near term we should probably take the patch
> > that I originally proposed, just to ensure that no one hits the
> > bugs that Kinglong hit. That does still leave some gaps in the
> > seqid handling, but those are preferable to the warning and
> > deadlock.
> >
> > Bruce, does that sound reasonable? I can send that patch in a
> > separate email if you'd prefer.
>
> What is the patch you proposed? As far as I can tell the short term
> action would require two patches:
>
The one I proposed is the one earlier in the thread that just drops the
mutex once the stateid has been copied (and so no longer holds it over
the CB RPC).
> - treat 0 like NFS4ERR_DELAY (not directly related to your patch)
> - send the old layout stateid with a recall, and only increment it
> in nfsd4_cb_layout_release when we actually change the layout state
My understanding is that you need to increment the seqid when prior to
sending the callback. The basic idea there is that you want to ensure
that any LAYOUTGETs that were sent before the CB_LAYOUTRECALL get back
an OLD_STATEID error. RFC5661, Section 12.5.3:
After the layout stateid is established, the server increments by
one the value of the "seqid" in each subsequent LAYOUTGET and
LAYOUTRETURN response, and in each CB_LAYOUTRECALL request.
>
> We block all new LAYOUTGETS as long as fi_lo_recalls is non-zero,
> and we only only decrement it from nfsd4_cb_layout_release. The
> way I understand the RPC state machine that means we block new
> LAYOUTGETS until we have successfully finished the recall.
>
Ok, so if you do treat 0 like NFS4ERR_DELAY then we shouldn't loop like
I was thinking. We do block LAYOUTGETs for a little longer than is
necessary, since you need to wait for the client to return
NFS4ERR_NOMATCHING_LAYOUT before the ->release op gets called but I
guess we can live with that.
--
Jeff Layton <jlayton@poochiereds.net>
next prev parent reply other threads:[~2015-12-07 13:28 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 11:58 [PATCH RFC] nfsd: serialize layout stateid morphing operations Jeff Layton
2015-10-11 13:15 ` Christoph Hellwig
2015-10-11 20:51 ` Jeff Layton
2015-10-23 19:35 ` J. Bruce Fields
2015-11-29 4:07 ` Kinglong Mee
2015-11-29 13:46 ` Jeff Layton
2015-11-30 2:57 ` Kinglong Mee
2015-11-30 21:34 ` J. Bruce Fields
2015-12-01 0:33 ` Jeff Layton
2015-12-01 0:55 ` Trond Myklebust
2015-12-01 11:56 ` Christoph Hellwig
2015-12-01 22:48 ` Jeff Layton
2015-12-02 7:25 ` Christoph Hellwig
2015-12-03 22:08 ` J. Bruce Fields
2015-12-04 8:38 ` Christoph Hellwig
2015-12-04 20:51 ` Jeff Layton
2015-12-05 12:02 ` Christoph Hellwig
2015-12-05 12:24 ` Jeff Layton
2015-12-06 13:09 ` Jeff Layton
2015-12-07 13:09 ` Christoph Hellwig
2015-12-07 13:28 ` Jeff Layton [this message]
2015-12-07 14:17 ` Christoph Hellwig
2015-12-07 16:12 ` Jeff Layton
2015-12-07 16:43 ` J. Bruce Fields
2015-12-16 16:55 ` J. Bruce Fields
2015-12-07 13:07 ` Christoph Hellwig
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=20151207082803.0b160bb6@tlielax.poochiereds.net \
--to=jlayton@poochiereds.net \
--cc=bfields@fieldses.org \
--cc=hch@lst.de \
--cc=kinglongmee@gmail.com \
--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