Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nfsroot: make nfsroot to accept the 1024 bytes long directory name

although NFS_MAXPATHLEN is defined to 1024, nfs client hopes to accept
a 1024 byte path, but nfs_root_parms is limited to 256, and the nfs path
will truncated when a user inputs nfs path from kernel cmdline

enlarge nfs_root_parms to 1024, to make it accept the 1024 bytes long
directory name, since nfs_root_parms is defined as _initdata, it will
be released after system bootup

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

authored by

Li RongQing and committed by
Trond Myklebust
c6466193 c6fa8e6d

+1 -1
+1 -1
fs/nfs/nfsroot.c
··· 90 90 #define NFS_DEF_OPTIONS "vers=2,udp,rsize=4096,wsize=4096" 91 91 92 92 /* Parameters passed from the kernel command line */ 93 - static char nfs_root_parms[256] __initdata = ""; 93 + static char nfs_root_parms[NFS_MAXPATHLEN + 1] __initdata = ""; 94 94 95 95 /* Text-based mount options passed to super.c */ 96 96 static char nfs_root_options[256] __initdata = NFS_DEF_OPTIONS;