Blame SOURCES/autofs-5.1.4-fix-NFS-version-mask-usage.patch

135b98
autofs-5.1.4 - fix NFS version mask usage
135b98
135b98
From: Ian Kent <raven@themaw.net>
135b98
135b98
Upstream commit a8af65195 changed NFS_VERS_MASK to exclude NFSv2
135b98
so NFSv2 would be excluded in the default availability probe.
135b98
135b98
But NFS_VERS_MASK is used like a mask elsewhere and causes NFSv2
135b98
to be cleared for the availability probe even when it is requested.
135b98
135b98
So add a macro to NFS_VERS_DEFAULT (and accompanying macros) to be
135b98
used to set initial defaults and restore NFS_VERS_MASK to what it
135b98
should be when used as a mask.
135b98
135b98
Signed-off-by: Ian Kent <raven@themaw.net>
135b98
---
135b98
 CHANGELOG            |    1 +
135b98
 include/replicated.h |    5 ++++-
135b98
 modules/mount_nfs.c  |    6 +++---
135b98
 3 files changed, 8 insertions(+), 4 deletions(-)
135b98
135b98
--- autofs-5.1.4.orig/CHANGELOG
135b98
+++ autofs-5.1.4/CHANGELOG
135b98
@@ -23,6 +23,7 @@ xx/xx/2018 autofs-5.1.5
135b98
 - tiny patch for autofs typo and possible bug.
135b98
 - add units After line to include statd service.
135b98
 - use systemd sd_notify() at startup.
135b98
+- fix NFS version mask usage.
135b98
 
135b98
 19/12/2017 autofs-5.1.4
135b98
 - fix spec file url.
135b98
--- autofs-5.1.4.orig/include/replicated.h
135b98
+++ autofs-5.1.4/include/replicated.h
135b98
@@ -26,7 +26,9 @@
135b98
 #define NFS2_SUPPORTED		0x0010
135b98
 #define NFS3_SUPPORTED		0x0020
135b98
 #define NFS4_SUPPORTED		0x0040
135b98
-#define NFS_VERS_MASK		(NFS3_SUPPORTED)
135b98
+#define NFS_VERS_DEFAULT	(NFS3_SUPPORTED)
135b98
+#define NFS_VERS_MASK		(NFS2_SUPPORTED|NFS3_SUPPORTED)
135b98
+#define NFS4_VERS_DEFAULT	(NFS4_SUPPORTED)
135b98
 #define NFS4_VERS_MASK		(NFS4_SUPPORTED)
135b98
 
135b98
 #define NFS2_REQUESTED		NFS2_SUPPORTED
135b98
@@ -39,6 +41,7 @@
135b98
 #define UDP_REQUESTED		UDP_SUPPORTED
135b98
 #define TCP6_REQUESTED		0x0100
135b98
 #define UDP6_REQUESTED		0x0200
135b98
+#define NFS_PROTO_DEFAULT	(TCP_SUPPORTED|UDP_SUPPORTED)
135b98
 #define NFS_PROTO_MASK		(TCP_SUPPORTED|UDP_SUPPORTED)
135b98
 
135b98
 #define NFS2_TCP_SUPPORTED	NFS2_SUPPORTED
135b98
--- autofs-5.1.4.orig/modules/mount_nfs.c
135b98
+++ autofs-5.1.4/modules/mount_nfs.c
135b98
@@ -86,11 +86,11 @@ int mount_mount(struct autofs_point *ap,
135b98
 	      root, name, what, fstype, options);
135b98
 
135b98
 	mount_default_proto = defaults_get_mount_nfs_default_proto();
135b98
-	vers = NFS_VERS_MASK | NFS_PROTO_MASK;
135b98
+	vers = NFS_VERS_DEFAULT | NFS_PROTO_DEFAULT;
135b98
 	if (strcmp(fstype, "nfs4") == 0)
135b98
-		vers = NFS4_VERS_MASK | TCP_SUPPORTED;
135b98
+		vers = NFS4_VERS_DEFAULT | TCP_SUPPORTED;
135b98
 	else if (mount_default_proto == 4)
135b98
-		vers = vers | NFS4_VERS_MASK;
135b98
+		vers = vers | NFS4_VERS_DEFAULT;
135b98
 
135b98
 	/* Extract "nosymlink" pseudo-option which stops local filesystems
135b98
 	 * from being symlinked.