Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d1cca72994c0e910ca443076dcfcfd473871dda
Commit:     7d1cca72994c0e910ca443076dcfcfd473871dda
Parent:     350c73af6af51ae7654dad91874c0d30dd13bbbe
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 29 17:59:03 2007 -0400
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Sat Sep 1 10:14:40 2007 -0400

    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 <[EMAIL PROTECTED]>
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/super.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index ef36432..8ed5937 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,
                        return -EINVAL;
                len = c - dev_name;
                if (len > sizeof(data->hostname))
-                       return -EINVAL;
+                       return -ENAMETOOLONG;
                strncpy(data->hostname, dev_name, len);
                args.nfs_server.hostname = data->hostname;
 
                c++;
                if (strlen(c) > NFS_MAXPATHLEN)
-                       return -EINVAL;
+                       return -ENAMETOOLONG;
                args.nfs_server.export_path = c;
 
                status = nfs_try_mount(&args, mntfh);
@@ -1677,7 +1677,7 @@ static int nfs4_validate_mount_data(struct 
nfs4_mount_data **options,
                /* while calculating len, pretend ':' is '\0' */
                len = c - dev_name;
                if (len > NFS4_MAXNAMLEN)
-                       return -EINVAL;
+                       return -ENAMETOOLONG;
                *hostname = kzalloc(len, GFP_KERNEL);
                if (*hostname == NULL)
                        return -ENOMEM;
@@ -1686,7 +1686,7 @@ static int nfs4_validate_mount_data(struct 
nfs4_mount_data **options,
                c++;                    /* step over the ':' */
                len = strlen(c);
                if (len > NFS4_MAXPATHLEN)
-                       return -EINVAL;
+                       return -ENAMETOOLONG;
                *mntpath = kzalloc(len + 1, GFP_KERNEL);
                if (*mntpath == NULL)
                        return -ENOMEM;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to