Commit 5680d48be88d12cd987e5579a6072a4ca34ca6ea

Authored by Chuck Lever
Committed by Trond Myklebust
1 parent 9eaa67c6a5

NFS: Clean-up: Define macros for maximum host and export path name lengths

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -867,12 +867,12 @@
867 867 }
868 868 }
869 869  
870   - p = nfs_copy_user_string(NULL, &data->hostname, 256);
  870 + p = nfs_copy_user_string(NULL, &data->hostname, NFS4_MAXNAMLEN);
871 871 if (IS_ERR(p))
872 872 goto out_err;
873 873 hostname = p;
874 874  
875   - p = nfs_copy_user_string(NULL, &data->mnt_path, 1024);
  875 + p = nfs_copy_user_string(NULL, &data->mnt_path, NFS4_MAXPATHLEN);
876 876 if (IS_ERR(p))
877 877 goto out_err;
878 878 mntpath = p;
include/linux/nfs_mount.h
... ... @@ -37,7 +37,7 @@
37 37 int acdirmin; /* 1 */
38 38 int acdirmax; /* 1 */
39 39 struct sockaddr_in addr; /* 1 */
40   - char hostname[256]; /* 1 */
  40 + char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
41 41 int namlen; /* 2 */
42 42 unsigned int bsize; /* 3 */
43 43 struct nfs3_fh root; /* 4 */