linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trond Myklebust <Trond.Myklebust@netapp.com>
To: andros@netapp.com
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH 2/5] nfs41: directly encode back channel error
Date: Mon, 11 Jan 2010 18:10:57 -0500	[thread overview]
Message-ID: <1263251457.2663.7.camel@localhost> (raw)
In-Reply-To: <1262802213-2267-3-git-send-email-andros@netapp.com>

On Wed, 2010-01-06 at 13:23 -0500, andros@netapp.com wrote: 
> From: Andy Adamson <andros@netapp.com>
> 
> Skip all other processing when error is encountered.
> 
> Signed-off-by: Andy Adamson <andros@netapp.com>
> ---
>  fs/nfs/callback_xdr.c |    9 ++++++---
>  1 files changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
> index e24487d..3637e9a 100644
> --- a/fs/nfs/callback_xdr.c
> +++ b/fs/nfs/callback_xdr.c
> @@ -613,7 +613,7 @@ static __be32 process_op(uint32_t minorversion, int nop,
>  	dprintk("%s: start\n", __func__);
>  	status = decode_op_hdr(xdr_in, &op_nr);
>  	if (unlikely(status))
> -		goto out;
> +		goto encode_hdr;
>  
>  	dprintk("%s: minorversion=%d nop=%d op_nr=%u\n",
>  		__func__, minorversion, nop, op_nr);
> @@ -622,16 +622,19 @@ static __be32 process_op(uint32_t minorversion, int nop,
>  				preprocess_nfs4_op(op_nr, &op);
>  	if (status == htonl(NFS4ERR_OP_ILLEGAL))
>  		op_nr = OP_CB_ILLEGAL;
> -out:
> +	if (status)
> +		goto encode_hdr;
> +
>  	maxlen = xdr_out->end - xdr_out->p;
>  	if (maxlen > 0 && maxlen < PAGE_SIZE) {
> -		if (likely(status == 0 && op->decode_args != NULL))
> +		if (likely(op->decode_args != NULL))
>  			status = op->decode_args(rqstp, xdr_in, argp);
>  		if (likely(status == 0 && op->process_op != NULL))
>  			status = op->process_op(argp, resp);
>  	} else
>  		status = htonl(NFS4ERR_RESOURCE);
>  
> +encode_hdr:
>  	res = encode_op_hdr(xdr_out, op_nr, status);
>  	if (status == 0)
>  		status = res;

Same problem. You have a random value for op_nr...

  parent reply	other threads:[~2010-01-11 23:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-06 18:23 [PATCH 0/5] nfs41: return correct errors on callback replays andros
2010-01-06 18:23 ` [PATCH 1/5] nfs41: fix wrong error on callback decode hdr overflow andros
2010-01-06 18:23   ` [PATCH 2/5] nfs41: directly encode back channel error andros
2010-01-06 18:23     ` [PATCH 3/5] nfs41: remove uneeded checks in callback processing andros
2010-01-06 18:23       ` [PATCH 4/5] nfs41: prepare for back channel drc andros
2010-01-06 18:23         ` [PATCH 5/5] nfs41: back channel drc minimal implementation andros
2010-01-11 23:10     ` Trond Myklebust [this message]
2010-01-11 23:08   ` [PATCH 1/5] nfs41: fix wrong error on callback decode hdr overflow Trond Myklebust
2010-01-12 17:38     ` Andy Adamson

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=1263251457.2663.7.camel@localhost \
    --to=trond.myklebust@netapp.com \
    --cc=andros@netapp.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;
as well as URLs for NNTP newsgroup(s).