NFS: change NFS mount error return when hostname/pathname too long

According to the mount(2) man page, the proper error return code for the
mount(2) system call when the special device name or the mounted-on
directory name is too long is ENAMETOOLONG.

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

authored by Chuck Lever and committed by Trond Myklebust 7d1cca72 350c73af

+4 -4
+4 -4
fs/nfs/super.c
··· 1155 1155 return -EINVAL; 1156 1156 len = c - dev_name; 1157 1157 if (len > sizeof(data->hostname)) 1158 - return -EINVAL; 1158 + return -ENAMETOOLONG; 1159 1159 strncpy(data->hostname, dev_name, len); 1160 1160 args.nfs_server.hostname = data->hostname; 1161 1161 1162 1162 c++; 1163 1163 if (strlen(c) > NFS_MAXPATHLEN) 1164 - return -EINVAL; 1164 + return -ENAMETOOLONG; 1165 1165 args.nfs_server.export_path = c; 1166 1166 1167 1167 status = nfs_try_mount(&args, mntfh); ··· 1677 1677 /* while calculating len, pretend ':' is '\0' */ 1678 1678 len = c - dev_name; 1679 1679 if (len > NFS4_MAXNAMLEN) 1680 - return -EINVAL; 1680 + return -ENAMETOOLONG; 1681 1681 *hostname = kzalloc(len, GFP_KERNEL); 1682 1682 if (*hostname == NULL) 1683 1683 return -ENOMEM; ··· 1686 1686 c++; /* step over the ':' */ 1687 1687 len = strlen(c); 1688 1688 if (len > NFS4_MAXPATHLEN) 1689 - return -EINVAL; 1689 + return -ENAMETOOLONG; 1690 1690 *mntpath = kzalloc(len + 1, GFP_KERNEL); 1691 1691 if (*mntpath == NULL) 1692 1692 return -ENOMEM;