linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kinglong Mee <kinglongmee@gmail.com>
To: Trond Myklebust <trond.myklebust@primarydata.com>,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 4/5] NFSv4.x: Fix wraparound issues when validing the callback sequence id
Date: Sun, 31 Jan 2016 18:40:36 +0800	[thread overview]
Message-ID: <56ADE4A4.9060604@gmail.com> (raw)
In-Reply-To: <1453730956-5325-5-git-send-email-trond.myklebust@primarydata.com>


On 1/25/2016 22:09, Trond Myklebust wrote:
> We need to make sure that we don't allow args->csa_sequenceid == 0.
> 
> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> ---
>  fs/nfs/callback_proc.c | 43 +++++++++++++++++--------------------------
>  1 file changed, 17 insertions(+), 26 deletions(-)
... snip ...
> @@ -486,6 +476,13 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
>  		goto out_unlock;
>  	}
>  
> +	status = validate_seqid(tbl, slot, args);
> +	if (status)
> +		goto out_unlock;

For NFS4ERR_RETRY_UNCACHED_REP error, nfs should initialize
cb_sequenceres information, but goto out_unlock will skip it.

thanks,
Kinglong Mee

> +
> +	cps->slotid = args->csa_slotid;
> +	tbl->highest_used_slotid = args->csa_slotid;
> +
>  	memcpy(&res->csr_sessionid, &args->csa_sessionid,
>  	       sizeof(res->csr_sessionid));
>  	res->csr_sequenceid = args->csa_sequenceid;
> @@ -493,12 +490,6 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
>  	res->csr_highestslotid = tbl->server_highest_slotid;
>  	res->csr_target_highestslotid = tbl->target_highest_slotid;
>  
> -	status = validate_seqid(tbl, args);
> -	if (status)
> -		goto out_unlock;
> -
> -	cps->slotid = args->csa_slotid;
> -
>  	/* The ca_maxresponsesize_cached is 0 with no DRC */
>  	if (args->csa_cachethis != 0)
>  		return htonl(NFS4ERR_REP_TOO_BIG_TO_CACHE);
> @@ -518,7 +509,7 @@ __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
>  	 * If CB_SEQUENCE returns an error, then the state of the slot
>  	 * (sequence ID, cached reply) MUST NOT change.
>  	 */
> -	slot->seq_nr++;
> +	slot->seq_nr = args->csa_sequenceid;
>  out_unlock:
>  	spin_unlock(&tbl->slot_tbl_lock);
>  
> 

  parent reply	other threads:[~2016-01-31 10:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 14:09 [PATCH 0/5] Convert client back-channel to use session slot table Trond Myklebust
2016-01-25 14:09 ` [PATCH 1/5] NFSv4.x: Remove hard coded slotids in callback channel Trond Myklebust
2016-01-25 14:09   ` [PATCH 2/5] NFSv4.x: CB_SEQUENCE should return NFS4ERR_DELAY if still executing Trond Myklebust
2016-01-25 14:09     ` [PATCH 3/5] NFSv4.x: Enforce the ca_maxresponsesize_cached on the back channel Trond Myklebust
2016-01-25 14:09       ` [PATCH 4/5] NFSv4.x: Fix wraparound issues when validing the callback sequence id Trond Myklebust
2016-01-25 14:09         ` [PATCH 5/5] NFSv4.x: Allow multiple callbacks in flight Trond Myklebust
2016-01-25 14:32           ` kbuild test robot
2016-01-31 10:40         ` Kinglong Mee [this message]
2016-02-01 17:07           ` [PATCH 4/5] NFSv4.x: Fix wraparound issues when validing the callback sequence id Trond Myklebust
2016-01-26 19:22 ` [PATCH 0/5] Convert client back-channel to use session slot table Chuck Lever

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=56ADE4A4.9060604@gmail.com \
    --to=kinglongmee@gmail.com \
    --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).