Skip to contentSkip to conversation

A basic NFSv4 client for 2.5.x

PATCH New Trond Myklebust 1 participant 1 message Oct 8, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 5/19 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.

fs/nfs/dir.c +11 -4
diff -u --recursive --new-file linux-2.5.41-nfsv4-E04/fs/nfs/dir.c linux-2.5.41-nfsv4-E05/fs/nfs/dir.c
@@ -1022,16 +1022,23 @@
 	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)
-		goto out;
+	switch (NFS_PROTO(dir)->version) {
+		case 2:
+			if (strlen(symname) > NFS2_MAXPATHLEN)
+				goto out;
+			break;
+		case 3:
+			if (strlen(symname) > NFS3_MAXPATHLEN)
+				goto out;
+		default:
+			break;
+	}
 
 #ifdef NFS_PARANOIA
 if (dentry->d_inode)

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs