lkml.org 
[lkml]   [2002]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectREPOST patch 07/38: CLIENT: change hard limit on symlink length

In NFSv4, there is no hard limit on the length of symlink text.
This patch changes the -ENAMETOOLONG test in nfs_symlink() accordingly.

--- old/fs/nfs/dir.c Sun Aug 11 20:26:56 2002
+++ new/fs/nfs/dir.c Sun Aug 11 20:28:25 2002
@@ -1022,15 +1022,15 @@ nfs_symlink(struct inode *dir, struct de
struct nfs_fattr sym_attr;
struct nfs_fh sym_fh;
struct qstr qsymname;
- unsigned int maxlen;
int error;

dfprintk(VFS, "NFS: symlink(%s/%ld, %s, %s)\n", dir->i_sb->s_id,
dir->i_ino, dentry->d_name.name, symname);

error = -ENAMETOOLONG;
- maxlen = (NFS_PROTO(dir)->version==2) ? NFS2_MAXPATHLEN : NFS3_MAXPATHLEN;
- if (strlen(symname) > maxlen)
+ if (NFS_PROTO(dir)->version == 2 && strlen(symname) > NFS2_MAXPATHLEN)
+ goto out;
+ else if (NFS_PROTO(dir)->version == 3 && strlen(symname) > NFS3_MAXPATHLEN)
goto out;

#ifdef NFS_PARANOIA
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:22    [W:0.057 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site