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

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