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

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