* [PATCH] NFSD: Using type of uint32_t for ex_nflavors instead of int
@ 2014-05-24 3:26 Kinglong Mee
2014-05-27 15:47 ` J. Bruce Fields
0 siblings, 1 reply; 2+ messages in thread
From: Kinglong Mee @ 2014-05-24 3:26 UTC (permalink / raw)
To: J. Bruce Fields; +Cc: Linux NFS Mailing List, kinglongmee
ex_nflavors can't be negative number, just defined by uint32_t.
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
fs/nfsd/export.c | 7 ++++---
fs/nfsd/export.h | 2 +-
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 8513c59..9343ae2 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -437,13 +437,14 @@ out_free_all:
static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
{
- int listsize, err;
struct exp_flavor_info *f;
+ u32 listsize;
+ int err;
- err = get_int(mesg, &listsize);
+ err = get_uint(mesg, &listsize);
if (err)
return err;
- if (listsize < 0 || listsize > MAX_SECINFO_LIST)
+ if (listsize > MAX_SECINFO_LIST)
return -EINVAL;
for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) {
diff --git a/fs/nfsd/export.h b/fs/nfsd/export.h
index d7939a6..11d03b9 100644
--- a/fs/nfsd/export.h
+++ b/fs/nfsd/export.h
@@ -53,7 +53,7 @@ struct svc_export {
int ex_fsid;
unsigned char * ex_uuid; /* 16 byte fsid */
struct nfsd4_fs_locations ex_fslocs;
- int ex_nflavors;
+ uint32_t ex_nflavors;
struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST];
struct cache_detail *cd;
};
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] NFSD: Using type of uint32_t for ex_nflavors instead of int
2014-05-24 3:26 [PATCH] NFSD: Using type of uint32_t for ex_nflavors instead of int Kinglong Mee
@ 2014-05-27 15:47 ` J. Bruce Fields
0 siblings, 0 replies; 2+ messages in thread
From: J. Bruce Fields @ 2014-05-27 15:47 UTC (permalink / raw)
To: Kinglong Mee; +Cc: Linux NFS Mailing List
On Sat, May 24, 2014 at 11:26:49AM +0800, Kinglong Mee wrote:
> ex_nflavors can't be negative number, just defined by uint32_t.
OK, applying for 3.16.--b.
>
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
> fs/nfsd/export.c | 7 ++++---
> fs/nfsd/export.h | 2 +-
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 8513c59..9343ae2 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -437,13 +437,14 @@ out_free_all:
>
> static int secinfo_parse(char **mesg, char *buf, struct svc_export *exp)
> {
> - int listsize, err;
> struct exp_flavor_info *f;
> + u32 listsize;
> + int err;
>
> - err = get_int(mesg, &listsize);
> + err = get_uint(mesg, &listsize);
> if (err)
> return err;
> - if (listsize < 0 || listsize > MAX_SECINFO_LIST)
> + if (listsize > MAX_SECINFO_LIST)
> return -EINVAL;
>
> for (f = exp->ex_flavors; f < exp->ex_flavors + listsize; f++) {
> diff --git a/fs/nfsd/export.h b/fs/nfsd/export.h
> index d7939a6..11d03b9 100644
> --- a/fs/nfsd/export.h
> +++ b/fs/nfsd/export.h
> @@ -53,7 +53,7 @@ struct svc_export {
> int ex_fsid;
> unsigned char * ex_uuid; /* 16 byte fsid */
> struct nfsd4_fs_locations ex_fslocs;
> - int ex_nflavors;
> + uint32_t ex_nflavors;
> struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST];
> struct cache_detail *cd;
> };
> --
> 1.9.3
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-27 15:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-24 3:26 [PATCH] NFSD: Using type of uint32_t for ex_nflavors instead of int Kinglong Mee
2014-05-27 15:47 ` J. Bruce Fields
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox