All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Kinglong Mee <kinglongmee@gmail.com>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2] NFSD: Error out when getting more than one fsloc/secinfo/uuid
Date: Tue, 27 May 2014 11:47:13 -0400	[thread overview]
Message-ID: <20140527154713.GC21989@fieldses.org> (raw)
In-Reply-To: <53800FDD.7030001@gmail.com>

On Sat, May 24, 2014 at 11:19:57AM +0800, Kinglong Mee wrote:
> v2:
> remove WARN_ON_ONCE(1) and return -EINVAL instead of ignoring it. 

Thanks, applying.--b.

> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  fs/nfsd/export.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 7884051..13b85f9 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -389,6 +389,10 @@ fsloc_parse(char **mesg, char *buf, struct nfsd4_fs_locations *fsloc)
>  	int len;
>  	int migrated, i, err;
>  
> +	/* more than one fsloc */
> +	if (fsloc->locations)
> +		return -EINVAL;
> +
>  	/* listsize */
>  	err = get_uint(mesg, &fsloc->locations_count);
>  	if (err)
> @@ -442,6 +446,10 @@ static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
>  	u32 listsize;
>  	int err;
>  
> +	/* more than one secinfo */
> +	if (exp->ex_nflavors)
> +		return -EINVAL;
> +
>  	err = get_uint(mesg, &listsize);
>  	if (err)
>  		return err;
> @@ -481,6 +489,10 @@ uuid_parse(char **mesg, char *buf, unsigned char **puuid)
>  {
>  	int len;
>  
> +	/* more than one uuid */
> +	if (*puuid)
> +		return -EINVAL;
> +
>  	/* expect a 16 byte uuid encoded as \xXXXX... */
>  	len = qword_get(mesg, buf, PAGE_SIZE);
>  	if (len != EX_UUID_LEN)
> -- 
> 1.9.3
> 

      reply	other threads:[~2014-05-27 15:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-23 12:01 [PATCH 4/4] NFSD: Ignore and warn once for more fslocs or more uuids Kinglong Mee
2014-05-23 13:54 ` J. Bruce Fields
2014-05-23 14:24   ` Kinglong Mee
2014-05-23 14:41     ` J. Bruce Fields
2014-05-24  3:19       ` [PATCH v2] NFSD: Error out when getting more than one fsloc/secinfo/uuid Kinglong Mee
2014-05-27 15:47         ` J. Bruce Fields [this message]

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=20140527154713.GC21989@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=kinglongmee@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.