Package: busybox / 1:1.22.0-9+deb8u1

stop-checking-ancient-kernel-version.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From: Michael Tokarev <mjt@tls.msk.ru>
Subject: stop checking ancient kernel version for NFS mount
Forwarded: no
Bug-Debian: http://bugs.debian.org/684611

The nfs mount code checks for ancient kernel 2.2.18 (!) to determine
which mount protocol to use (v3 or v4).  Stop doing this, and always
use v4.

This is the only place in debian busybox which uses get_linux_version_code()
function which can't deal with less-than-3-component kernel version numbers
(#684611).  (Other places are in modutils/ to determine whenever to use
pre-2.4 module loading way, which is disabled in debian build).

This is a band-aid patch, to minimize changes, more complete cleanup
is needed for all this code upstream.

--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -285,9 +285,6 @@
 
 
 struct globals {
-#if ENABLE_FEATURE_MOUNT_NFS
-	smalluint nfs_mount_version;
-#endif
 #if ENABLE_FEATURE_MOUNT_VERBOSE
 	unsigned verbose;
 #endif
@@ -296,7 +293,7 @@
 } FIX_ALIASING;
 enum { GETMNTENT_BUFSIZE = COMMON_BUFSIZE - offsetof(struct globals, getmntent_buf) };
 #define G (*(struct globals*)&bb_common_bufsiz1)
-#define nfs_mount_version (G.nfs_mount_version)
+#define nfs_mount_version 4 /* assume kernel>= 2.4, use v4 nfs mount protocol */
 #if ENABLE_FEATURE_MOUNT_VERBOSE
 #define verbose           (G.verbose          )
 #else
@@ -937,6 +934,7 @@
 static void
 find_kernel_nfs_mount_version(void)
 {
+#if 0
 	int kernel_version;
 
 	if (nfs_mount_version)
@@ -950,6 +948,7 @@
 			nfs_mount_version = 3;
 		/* else v4 since 2.3.99pre4 */
 	}
+#endif
 }
 
 static void