aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-08-29 17:59:03 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-09-01 10:14:40 -0400
commit7d1cca72994c0e910ca443076dcfcfd473871dda (patch)
tree298d60951f738592c0ac19aea5cb1e5e57f113a7 /fs/nfs
parent350c73af6af51ae7654dad91874c0d30dd13bbbe (diff)
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/super.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index ef3643284f72..8ed593766f16 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1155,13 +1155,13 @@ static int nfs_validate_mount_data(struct nfs_mount_data **options,
1155 return -EINVAL; 1155 return -EINVAL;
1156 len = c - dev_name; 1156 len = c - dev_name;
1157 if (len > sizeof(data->hostname)) 1157 if (len > sizeof(data->hostname))
1158 return -EINVAL; 1158 return -ENAMETOOLONG;
1159 strncpy(data->hostname, dev_name, len); 1159 strncpy(data->hostname, dev_name, len);
1160 args.nfs_server.hostname = data->hostname; 1160 args.nfs_server.hostname = data->hostname;
1161 1161
1162 c++; 1162 c++;
1163 if (strlen(c) > NFS_MAXPATHLEN) 1163 if (strlen(c) > NFS_MAXPATHLEN)
1164 return -EINVAL; 1164 return -ENAMETOOLONG;
1165 args.nfs_server.export_path = c; 1165 args.nfs_server.export_path = c;
1166 1166
1167 status = nfs_try_mount(&args, mntfh); 1167 status = nfs_try_mount(&args, mntfh);
@@ -1677,7 +1677,7 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
1677 /* while calculating len, pretend ':' is '\0' */ 1677 /* while calculating len, pretend ':' is '\0' */
1678 len = c - dev_name; 1678 len = c - dev_name;
1679 if (len > NFS4_MAXNAMLEN) 1679 if (len > NFS4_MAXNAMLEN)
1680 return -EINVAL; 1680 return -ENAMETOOLONG;
1681 *hostname = kzalloc(len, GFP_KERNEL); 1681 *hostname = kzalloc(len, GFP_KERNEL);
1682 if (*hostname == NULL) 1682 if (*hostname == NULL)
1683 return -ENOMEM; 1683 return -ENOMEM;
@@ -1686,7 +1686,7 @@ static int nfs4_validate_mount_data(struct nfs4_mount_data **options,
1686 c++; /* step over the ':' */ 1686 c++; /* step over the ':' */
1687 len = strlen(c); 1687 len = strlen(c);
1688 if (len > NFS4_MAXPATHLEN) 1688 if (len > NFS4_MAXPATHLEN)
1689 return -EINVAL; 1689 return -ENAMETOOLONG;
1690 *mntpath = kzalloc(len + 1, GFP_KERNEL); 1690 *mntpath = kzalloc(len + 1, GFP_KERNEL);
1691 if (*mntpath == NULL) 1691 if (*mntpath == NULL)
1692 return -ENOMEM; 1692 return -ENOMEM;