summaryrefslogtreecommitdiff
path: root/fs/nfs/nfsroot.c
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2020-10-16 12:13:00 +0200
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2020-11-02 10:29:03 -0500
commit3fc2bfa365311c6ef3e4411437786a54a911d9a9 (patch)
tree866b2dface9d4f3890c15a4814e1ee7574239d9b /fs/nfs/nfsroot.c
parent3cea11cd5e3b00d91caf0b4730194039b45c5891 (diff)
downloadlwn-3fc2bfa365311c6ef3e4411437786a54a911d9a9.tar.gz
lwn-3fc2bfa365311c6ef3e4411437786a54a911d9a9.zip
nfsroot: Default mount option should ask for built-in NFS version
Change the nfsroot default mount option to ask for NFSv2 only *if* the kernel was built with NFSv2 support. If not, default to NFSv3 or as last choice to NFSv4, depending on actual kernel config. Signed-off-by: Helge Deller <deller@gmx.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/nfsroot.c')
-rw-r--r--fs/nfs/nfsroot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/nfs/nfsroot.c b/fs/nfs/nfsroot.c
index 8d3278805602..fa148308822c 100644
--- a/fs/nfs/nfsroot.c
+++ b/fs/nfs/nfsroot.c
@@ -88,7 +88,13 @@
#define NFS_ROOT "/tftpboot/%s"
/* Default NFSROOT mount options. */
+#if defined(CONFIG_NFS_V2)
#define NFS_DEF_OPTIONS "vers=2,tcp,rsize=4096,wsize=4096"
+#elif defined(CONFIG_NFS_V3)
+#define NFS_DEF_OPTIONS "vers=3,tcp,rsize=4096,wsize=4096"
+#else
+#define NFS_DEF_OPTIONS "vers=4,tcp,rsize=4096,wsize=4096"
+#endif
/* Parameters passed from the kernel command line */
static char nfs_root_parms[NFS_MAXPATHLEN + 1] __initdata = "";