Commit c22994ae authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] A basic NFSv4 client for 2.5.x

In NFSv4, there is no hard limit on the length of symlink text.
This patch changes the -ENAMETOOLONG test in nfs_symlink() accordingly.
parent 62d86355
...@@ -1022,16 +1022,23 @@ nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) ...@@ -1022,16 +1022,23 @@ nfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
struct nfs_fattr sym_attr; struct nfs_fattr sym_attr;
struct nfs_fh sym_fh; struct nfs_fh sym_fh;
struct qstr qsymname; struct qstr qsymname;
unsigned int maxlen;
int error; int error;
dfprintk(VFS, "NFS: symlink(%s/%ld, %s, %s)\n", dir->i_sb->s_id, dfprintk(VFS, "NFS: symlink(%s/%ld, %s, %s)\n", dir->i_sb->s_id,
dir->i_ino, dentry->d_name.name, symname); dir->i_ino, dentry->d_name.name, symname);
error = -ENAMETOOLONG; error = -ENAMETOOLONG;
maxlen = (NFS_PROTO(dir)->version==2) ? NFS2_MAXPATHLEN : NFS3_MAXPATHLEN; switch (NFS_PROTO(dir)->version) {
if (strlen(symname) > maxlen) case 2:
goto out; if (strlen(symname) > NFS2_MAXPATHLEN)
goto out;
break;
case 3:
if (strlen(symname) > NFS3_MAXPATHLEN)
goto out;
default:
break;
}
#ifdef NFS_PARANOIA #ifdef NFS_PARANOIA
if (dentry->d_inode) if (dentry->d_inode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment