linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frank Filz <ffilz@redhat.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>, bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/5] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0)
Date: Tue, 31 Oct 2017 10:32:44 -0700	[thread overview]
Message-ID: <a18842ca-ee82-647a-f275-fd29be31e3f5@redhat.com> (raw)
In-Reply-To: <20171031000951.18294-3-trond.myklebust@primarydata.com>

On 10/30/2017 05:09 PM, Trond Myklebust wrote:
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  fs/nfsd/nfs4state.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index b246aaa20863..0fa42c704b9a 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -63,6 +63,9 @@ static const stateid_t zero_stateid = {
>  static const stateid_t currentstateid = {
>  	.si_generation = 1,
>  };
> +static const stateid_t close_stateid = {
> +	.si_generation = 0xffffffffU,
> +};
>  
>  static u64 current_sessionid = 1;
>  
> @@ -5390,6 +5393,11 @@ nfsd4_close(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  	nfsd4_close_open_stateid(stp);
>  	mutex_unlock(&stp->st_mutex);
>  
> +	/* See RFC5661 sectionm 18.2.4 */
> +	if (stp->st_stid.sc_client->cl_minorversion)
> +		memcpy(&close->cl_stateid, &close_stateid,
> +				sizeof(close->cl_stateid));
> +
>  	/* put reference from nfs4_preprocess_seqid_op */
>  	nfs4_put_stid(&stp->st_stid);
>  out:

Ooh, I'd never noticed that... Ganesha needs to do that also.


Bruce, can we get a pynfs test case to verify this?


Thanks

Frank


  parent reply	other threads:[~2017-10-31 17:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-31  0:09 [PATCH 0/5] Tighten up locking around stateids in knfsd Trond Myklebust
2017-10-31  0:09 ` [PATCH 1/5] nfsd: Fix stateid races between OPEN and CLOSE Trond Myklebust
2017-10-31  0:09   ` [PATCH 2/5] nfsd: CLOSE SHOULD return the invalid special stateid for NFSv4.x (x>0) Trond Myklebust
2017-10-31  0:09     ` [PATCH 3/5] nfsd: Ensure we don't recognise lock stateids after freeing them Trond Myklebust
2017-10-31  0:09       ` [PATCH 4/5] nfsd: Ensure we check stateid validity in the seqid operation checks Trond Myklebust
2017-10-31  0:09         ` [PATCH 5/5] nfsd: Fix races with check_stateid_generation() Trond Myklebust
2017-10-31 17:32     ` Frank Filz [this message]
2017-10-31 22:33   ` [PATCH 1/5] nfsd: Fix stateid races between OPEN and CLOSE Andrew W Elble
2017-10-31 23:24     ` Trond Myklebust
2017-10-31 23:45       ` Andrew W Elble

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=a18842ca-ee82-647a-f275-fd29be31e3f5@redhat.com \
    --to=ffilz@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).