NFSD: Using type of uint32_t for ex_nflavors instead of int
authorKinglong Mee <kinglongmee@gmail.com>
Sat, 24 May 2014 03:26:49 +0000 (11:26 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 30 May 2014 21:32:24 +0000 (17:32 -0400)
ex_nflavors can't be negative number, just defined by uint32_t.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/export.c
fs/nfsd/export.h

index 263d30e7972e8d4103bc9dbaef89d20c9594bdbf..7884051070069a4fd143ef356aa7147791cf304f 100644 (file)
@@ -438,13 +438,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++) {
index c7d4ed05e470c28ea14d870a130cd0a0d1a96c60..cfeea85c5bed1f20bdc56e261423c6d95d6a8c7b 100644 (file)
@@ -54,7 +54,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;
 };