From 065c7e779a0ab49267ef18f2f851d9886719151c Mon Sep 17 00:00:00 2001 From: Mark Whitley Date: Thu, 1 Feb 2001 19:51:13 +0000 Subject: [PATCH] Applied patch from Chris Jaeger to do better checking for NFS_MOUNT_VERSION, depending on which kernel you're running. --- nfsmount.c | 19 +++++++++++-------- util-linux/nfsmount.c | 19 +++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/nfsmount.c b/nfsmount.c index 397858b71..e615d1d63 100644 --- a/nfsmount.c +++ b/nfsmount.c @@ -183,7 +183,8 @@ static int nfs_mount_version; * nfs_mount_version: version this source and running kernel can handle */ static void -find_kernel_nfs_mount_version(void) { +find_kernel_nfs_mount_version(void) +{ static int kernel_version = 0; if (kernel_version) @@ -193,15 +194,17 @@ find_kernel_nfs_mount_version(void) { kernel_version = get_kernel_revision(); if (kernel_version) { - if (kernel_version < MAKE_VERSION(2,1,32)) - nfs_mount_version = 1; - else if (kernel_version < MAKE_VERSION(2,3,99)) - nfs_mount_version = 3; - else - nfs_mount_version = 4; /* since 2.3.99pre4 */ + if (kernel_version < MAKE_VERSION(2,1,32)) + nfs_mount_version = 1; + else if (kernel_version < MAKE_VERSION(2,2,18) || + (kernel_version >= MAKE_VERSION(2,3,0) && + kernel_version < MAKE_VERSION(2,3,99))) + nfs_mount_version = 3; + else + nfs_mount_version = 4; /* since 2.3.99pre4 */ } if (nfs_mount_version > NFS_MOUNT_VERSION) - nfs_mount_version = NFS_MOUNT_VERSION; + nfs_mount_version = NFS_MOUNT_VERSION; } static struct pmap * diff --git a/util-linux/nfsmount.c b/util-linux/nfsmount.c index 397858b71..e615d1d63 100644 --- a/util-linux/nfsmount.c +++ b/util-linux/nfsmount.c @@ -183,7 +183,8 @@ static int nfs_mount_version; * nfs_mount_version: version this source and running kernel can handle */ static void -find_kernel_nfs_mount_version(void) { +find_kernel_nfs_mount_version(void) +{ static int kernel_version = 0; if (kernel_version) @@ -193,15 +194,17 @@ find_kernel_nfs_mount_version(void) { kernel_version = get_kernel_revision(); if (kernel_version) { - if (kernel_version < MAKE_VERSION(2,1,32)) - nfs_mount_version = 1; - else if (kernel_version < MAKE_VERSION(2,3,99)) - nfs_mount_version = 3; - else - nfs_mount_version = 4; /* since 2.3.99pre4 */ + if (kernel_version < MAKE_VERSION(2,1,32)) + nfs_mount_version = 1; + else if (kernel_version < MAKE_VERSION(2,2,18) || + (kernel_version >= MAKE_VERSION(2,3,0) && + kernel_version < MAKE_VERSION(2,3,99))) + nfs_mount_version = 3; + else + nfs_mount_version = 4; /* since 2.3.99pre4 */ } if (nfs_mount_version > NFS_MOUNT_VERSION) - nfs_mount_version = NFS_MOUNT_VERSION; + nfs_mount_version = NFS_MOUNT_VERSION; } static struct pmap * -- 2.25.1