Linux NFS development
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: "William A. (Andy) Adamson" <androsadamson@gmail.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] SQUASHME: pnfs: check for read_buf error in decode_pnfs_layoutrecall_args
Date: Tue, 29 Jun 2010 16:00:03 +0300	[thread overview]
Message-ID: <4C29EE53.5020703@panasas.com> (raw)
In-Reply-To: <AANLkTiku06tjr1NCt4kJMJOlDne11zhRHKkJMc67-DvR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Jun. 29, 2010, 15:22 +0300, "William A. (Andy) Adamson" <androsadamson@gmail.com> wrote:
> I see that NFS4ERR_RESOURCE is returned throughout callback_xdr.c ,but
> it is not a legal error return for NFSv4.1. -ENOMEM would be better.

Sigh... it is indeed.

You mean NFS4ERR_DELAY?

Benny

> 
> -->Andy
> 
> On Tue, Jun 29, 2010 at 6:55 AM, Benny Halevy <bhalevy@panasas.com> wrote:
>> read_buf may return NULL. return NFS4ERR_RESOURCE in this case.
>>
>> Signed-off-by: Benny Halevy <bhalevy@panasas.com>
>> ---
>>  fs/nfs/callback_xdr.c |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/fs/nfs/callback_xdr.c b/fs/nfs/callback_xdr.c
>> index 7e34bb3..2f69f0d 100644
>> --- a/fs/nfs/callback_xdr.c
>> +++ b/fs/nfs/callback_xdr.c
>> @@ -247,6 +247,10 @@ static __be32 decode_pnfs_layoutrecall_args(struct svc_rqst *rqstp,
>>                        goto out;
>>
>>                p = read_buf(xdr, 2 * sizeof(uint64_t));
>> +               if (unlikely(p == NULL)) {
>> +                       status = htonl(NFS4ERR_RESOURCE);
>> +                       goto out;
>> +               }
>>                p = xdr_decode_hyper(p, &args->cbl_seg.offset);
>>                p = xdr_decode_hyper(p, &args->cbl_seg.length);
>>                status = decode_stateid(xdr, &args->cbl_stateid);
>> @@ -254,6 +258,10 @@ static __be32 decode_pnfs_layoutrecall_args(struct svc_rqst *rqstp,
>>                        goto out;
>>        } else if (args->cbl_recall_type == RETURN_FSID) {
>>                p = read_buf(xdr, 2 * sizeof(uint64_t));
>> +               if (unlikely(p == NULL)) {
>> +                       status = htonl(NFS4ERR_RESOURCE);
>> +                       goto out;
>> +               }
>>                p = xdr_decode_hyper(p, &args->cbl_fsid.major);
>>                p = xdr_decode_hyper(p, &args->cbl_fsid.minor);
>>        }
>> --
>> 1.6.6.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


  parent reply	other threads:[~2010-06-29 13:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-29 10:55 [PATCH] SQUASHME: pnfs: check for read_buf error in decode_pnfs_layoutrecall_args Benny Halevy
2010-06-29 12:22 ` William A. (Andy) Adamson
     [not found]   ` <AANLkTiku06tjr1NCt4kJMJOlDne11zhRHKkJMc67-DvR-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-06-29 13:00     ` Benny Halevy [this message]
2010-06-29 13:19       ` Andy Adamson
2010-06-29 13:57         ` Benny Halevy

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=4C29EE53.5020703@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=androsadamson@gmail.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