Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Tue, 13 Aug 2002 18:57:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Tue, 13 Aug 2002 18:56:36 -0400 Received: from berzerk.gpcc.itd.umich.edu ([141.211.2.162]:39053 "EHLO berzerk.gpcc.itd.umich.edu") by vger.kernel.org with ESMTP id ; Tue, 13 Aug 2002 18:55:31 -0400 Date: Tue, 13 Aug 2002 18:59:20 -0400 (EDT) From: "Kendrick M. Smith" X-X-Sender: kmsmith@rastan.gpcc.itd.umich.edu To: linux-kernel@vger.kernel.org, Subject: patch 08/38: CLIENT: change hard limit on symlink length Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1099 Lines: 31 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 Mon Jul 29 22:54:08 2002 +++ new/fs/nfs/dir.c Mon Jul 29 11:50:09 2002 @@ -898,15 +898,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/