linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@redhat.com>
To: Olga Kornievskaia <aglo@umich.edu>
Cc: Trond Myklebust <trond.myklebust@primarydata.com>,
	linux-nfs <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH 1/2] nfsd4: fix cached replies to solo SEQUENCE compounds
Date: Thu, 19 Oct 2017 16:20:15 -0400	[thread overview]
Message-ID: <20171019202015.GG16942@parsley.fieldses.org> (raw)
In-Reply-To: <CAN-5tyFCBrfLnw91R5awik6+miCO7vGfB-K40D1yQw-+nJ6eiQ@mail.gmail.com>

On Thu, Oct 19, 2017 at 02:34:20PM -0400, Olga Kornievskaia wrote:
> On Thu, Oct 19, 2017 at 2:17 PM, J. Bruce Fields <bfields@redhat.com> wrote:
> > On Thu, Oct 19, 2017 at 01:21:46PM -0400, Olga Kornievskaia wrote:
> >> On Wed, Oct 18, 2017 at 5:25 PM, J. Bruce Fields <bfields@redhat.com> wrote:
> >> > From: "J. Bruce Fields" <bfields@redhat.com>
> >> >
> >> > Currently our handling of 4.1+ requests without "cachethis" set is
> >> > confusing and not quite correct.
> >> >
> >> > Suppose a client sends a compound consisting of only a single SEQUENCE
> >> > op, and it matches the seqid in a session slot (so it's a retry), but
> >> > the previous request with that seqid did not have "cachethis" set.
> >> >
> >> > The obvious thing to do might be to return NFS4ERR_RETRY_UNCACHED_REP,
> >> > but the protocol only allows that to be returned on the op following the
> >> > SEQUENCE, and there is no such op in this case.
> >> >
> >> > The protocol permits us to cache replies even if the client didn't ask
> >> > us to.  And it's easy to do so in the case of solo SEQUENCE compounds.
> >> >
> >> > So, when we get a solo SEQUENCE, we can either return the previously
> >> > cached reply or NFSERR_SEQ_FALSE_RETRY if we notice it differs in some
> >> > way from the original call.
> >>
> >> I'm confused in my testing the error was SEQ_MISORDERED and not
> >> SEQ_FALSE_RETRY error?
> >
> > Yes, I must have a typo somewhere, but I haven't spotted it yet.  That
> > was with both patches applied?
> 
> Yes both patches.

Some days I wonder if I should just turn in my C programmer card.

--b.

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 7bd3ad88b85c..8aeda6ad15b9 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -2294,7 +2294,7 @@ nfsd4_store_cache_entry(struct nfsd4_compoundres *resp)
 
 	slot->sl_flags |= NFSD4_SLOT_INITIALIZED;
 	if (!nfsd4_cache_this(resp)) {
-		slot->sl_flags &= !NFSD4_SLOT_CACHED;
+		slot->sl_flags &= ~NFSD4_SLOT_CACHED;
 		return;
 	}
 	slot->sl_flags |= NFSD4_SLOT_CACHED;

  reply	other threads:[~2017-10-19 20:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-11 17:07 [PATCH v2] NFSv4.1: Fix up replays of interrupted requests Trond Myklebust
2017-10-16 16:37 ` Olga Kornievskaia
2017-10-16 17:07   ` Olga Kornievskaia
2017-10-16 18:36     ` J. Bruce Fields
2017-10-16 19:20       ` Olga Kornievskaia
2017-10-18 21:23       ` J. Bruce Fields
2017-10-19 17:07         ` Olga Kornievskaia
2017-10-18 21:25     ` [PATCH 1/2] nfsd4: fix cached replies to solo SEQUENCE compounds J. Bruce Fields
2017-10-18 21:25       ` [PATCH 2/2] nfsd4: catch some false session retries J. Bruce Fields
2017-10-19 17:21       ` [PATCH 1/2] nfsd4: fix cached replies to solo SEQUENCE compounds Olga Kornievskaia
2017-10-19 18:17         ` J. Bruce Fields
2017-10-19 18:34           ` Olga Kornievskaia
2017-10-19 20:20             ` J. Bruce Fields [this message]
2017-10-19 21:04               ` Olga Kornievskaia
2017-10-19 21:19                 ` Olga Kornievskaia
2017-10-20 17:47                   ` J. Bruce Fields
2017-10-20 18:55                     ` Olga Kornievskaia
2017-10-20 20:44                       ` J. Bruce Fields
2017-10-19 18:33 ` [PATCH v2] NFSv4.1: Fix up replays of interrupted requests Olga Kornievskaia
2017-10-19 18:52   ` Trond Myklebust
2018-05-22 21:28 ` Olga Kornievskaia

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=20171019202015.GG16942@parsley.fieldses.org \
    --to=bfields@redhat.com \
    --cc=aglo@umich.edu \
    --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;
as well as URLs for NNTP newsgroup(s).