From: Jeff Layton <jeff.layton@primarydata.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Andrew W Elble <aweits@rit.edu>,
Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
Bruce James Fields <bfields@fieldses.org>
Subject: Re: [PATCH] nfsd: fix nfsd4_delegreturn to return correct error codes
Date: Fri, 6 Nov 2015 09:19:47 -0500 [thread overview]
Message-ID: <20151106091947.76de6de7@synchrony.poochiereds.net> (raw)
In-Reply-To: <CAHQdGtSNC_j7M9y40tNe=WzsqoECa3Y5gMSRsqx3bKsf79TsHA@mail.gmail.com>
On Fri, 6 Nov 2015 09:03:50 -0500
Trond Myklebust <trond.myklebust@primarydata.com> wrote:
> On Fri, Nov 6, 2015 at 8:48 AM, Trond Myklebust
> <trond.myklebust@primarydata.com> wrote:
> > On Fri, Nov 6, 2015 at 8:08 AM, Andrew W Elble <aweits@rit.edu> wrote:
> >>
> >>> Umm... If the client is sending delegreturn, then why not destroy the
> >>> delegation?
> >>
> >> ObDisclaimer: My "internal" version of this patch does just that.
> >>
> >> If the DELEGRETURN is the first time that the client hears of the
> >> revocation, I'm guessing that there isn't anything that can be done to
> >> rewind time and do anything differently. But as Bruce points out, it
> >> seems like there are other places where NFS4ERR_DELEG_REVOKED should be
> >> being returned.
> >>
> >>> What is the point of forcing the client to send
> >>> FREE_STATEID, when it is telling you that it is no longer caching any
> >>> locks or associated state and is no longer interested in keeping the
> >>> delegation?
> >>
> >> But - I keep re-reading RFC5661, and I can't figure out how this is
> >> what was intended.
> >>
> >> It seems like the "correct" thing to do is inform the client (via probably
> >> too many different methods) that the/a delegation is revoked and let it
> >> acknowledge via FREE_STATEID. The allowed error returns in 15.2 seem to
> >> confirm this view.
> >
> > Just because the protocol _allows_ you to do this, it doesn't mean
> > that it is the right thing to do.
> > Section 8.2.4. reads:
> >
> > Stateids must remain valid until either a client restart or a server
> > restart or until the client returns all of the locks associated with
> > the stateid by means of an operation such as CLOSE or DELEGRETURN.
> > If the locks are lost due to revocation, as long as the client ID is
> > valid, the stateid remains a valid designation of that revoked state
> > until the client frees it by using FREE_STATEID.
> >
> > In this case, there are no lost locks due to revocation.
> >
> > The client has presumably not received NFS4ERR_DELEG_REVOKED on any of
> > its previous uses of the delegation stateid and it has presumably not
> > seen any SEQ4_STATUS_* notifications when recovering locks, since both
> > of those situations should cause the client to switch to using
> > TEST_STATEID/FREE_STATEID instead of a DELEGRETURN.
> >
> > So, what exactly is the client supposed to do differently when the
> > server replies NFS4ERR_DELEG_REVOKED to the DELEGRETURN other than
> > send a completely redundant FREE_STATEID? Why couldn't the server just
> > return NFS4ERR_OK?
>
> BTW: even if you do return NFS4ERR_DELEG_REVOKED, there is precisely
> zero value in keeping the stateid around. It is perfectly legitimate
> to reply NFS4ERR_BAD_STATEID in reply to FREE_STATEID.
Yeah, agreed. Now that I think about it, you should just go ahead and
destroy the delegation as the client is signaling that it's through
with it anyway.
Hmm...so is there any advantage to reporting NFS4ERR_DELEG_REVOKED
there at all? I guess that could be a signal that it may not have held
a delegation that it thought it had, but it's probably too late to do
anything about it if that occurs. Some older clients may also not
handle that error gracefully too, so just returning NFS4_OK might be
best...
--
Jeff Layton <jeff.layton@primarydata.com>
next prev parent reply other threads:[~2015-11-06 14:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-04 22:07 [PATCH] nfsd: fix nfsd4_delegreturn to return correct error codes Andrew Elble
2015-11-05 21:58 ` J. Bruce Fields
2015-11-05 22:31 ` Trond Myklebust
2015-11-06 13:08 ` Andrew W Elble
2015-11-06 13:48 ` Trond Myklebust
2015-11-06 14:03 ` Trond Myklebust
2015-11-06 14:19 ` Jeff Layton [this message]
2015-11-06 15:29 ` Bruce James Fields
2015-11-06 17:00 ` Jeff Layton
2015-11-06 12:28 ` Jeff Layton
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=20151106091947.76de6de7@synchrony.poochiereds.net \
--to=jeff.layton@primarydata.com \
--cc=aweits@rit.edu \
--cc=bfields@fieldses.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trond.myklebust@primarydata.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