[autofs/f19] - add upstream patch to only probe specific protocol if given as an option. - add upstream patch to

Ian Kent iankent at fedoraproject.org
Wed Jul 10 02:14:50 UTC 2013


commit d7ca14531b0f89e1fe4b8f63feb278a605faaa12
Author: Ian Kent <ikent at redhat.com>
Date:   Wed Jul 10 10:14:09 2013 +0800

    - add upstream patch to only probe specific protocol if given as an option.
    - add upstream patch to respect ulimit setting if it is greater than the limit to be requested.

 autofs-5.0.7-check-for-protocol-option.patch       |   38 ++++++++++++++++++++
 ...en-files-if-greater-than-internal-maximum.patch |   30 +++++++++++++++
 autofs.spec                                        |   10 +++++-
 3 files changed, 77 insertions(+), 1 deletions(-)
---
diff --git a/autofs-5.0.7-check-for-protocol-option.patch b/autofs-5.0.7-check-for-protocol-option.patch
new file mode 100644
index 0000000..5a3464b
--- /dev/null
+++ b/autofs-5.0.7-check-for-protocol-option.patch
@@ -0,0 +1,38 @@
+autofs-5.0.7 - check for protocol option
+
+From: Ian Kent <raven at themaw.net>
+
+When a specific protocol is requested in the mount options only
+that protocol should be probed for.
+---
+ modules/mount_nfs.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c
+index 9de8a73..3d2ccea 100644
+--- a/modules/mount_nfs.c
++++ b/modules/mount_nfs.c
+@@ -156,6 +156,12 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
+ 					if (port < 0)
+ 						port = 0;
+ 					port_opt = cp;
++				} else if (strncmp("proto=udp", cp, o_len) == 0 ||
++					   strncmp("udp", cp, o_len) == 0) {
++					vers &= ~TCP_SUPPORTED;
++				} else if (strncmp("proto=tcp", cp, o_len) == 0 ||
++					   strncmp("tcp", cp, o_len) == 0) {
++					vers &= ~UDP_SUPPORTED;
+ 				}
+ 				/* Check for options that also make sense
+ 				   with bind mounts */
+@@ -167,6 +173,10 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int
+ 			}
+ 		}
+ 
++		/* In case both tcp and udp options were given */
++		if ((vers & NFS_PROTO_MASK) == 0)
++			vers |= NFS_PROTO_MASK;
++
+ 		debug(ap->logopt, MODPREFIX
+ 		      "nfs options=\"%s\", nobind=%d, nosymlink=%d, ro=%d",
+ 		      nfsoptions, nobind, nosymlink, ro);
diff --git a/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch b/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch
new file mode 100644
index 0000000..6574597
--- /dev/null
+++ b/autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch
@@ -0,0 +1,30 @@
+autofs-5.0.7 - use ulimit max open files if greater than internal maximum
+
+From: Ian Kent <raven at themaw.net>
+
+When setting the maximum number of allowed file handles the current setting
+should be checked before setting it. If the ulimit command has been used to
+increase the maximum to larger than what automount would ask for then honour
+it.
+---
+ daemon/automount.c |    7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/daemon/automount.c b/daemon/automount.c
+index 019637f..1d0b64e 100644
+--- a/daemon/automount.c
++++ b/daemon/automount.c
+@@ -2106,8 +2106,11 @@ int main(int argc, char *argv[])
+ 		exit(1);
+ 	}
+ 
+-	rlim.rlim_cur = MAX_OPEN_FILES;
+-	rlim.rlim_max = MAX_OPEN_FILES;
++	res = getrlimit(RLIMIT_NOFILE, &rlim);
++	if (res == -1 || rlim.rlim_max <= MAX_OPEN_FILES)  {
++		rlim.rlim_cur = MAX_OPEN_FILES;
++		rlim.rlim_max = MAX_OPEN_FILES;
++	}
+ 	res = setrlimit(RLIMIT_NOFILE, &rlim);
+ 	if (res)
+ 		printf("%s: can't increase open file limit - continuing",
diff --git a/autofs.spec b/autofs.spec
index 82dd328..8e1eab3 100644
--- a/autofs.spec
+++ b/autofs.spec
@@ -8,7 +8,7 @@
 Summary: A tool for automatically mounting and unmounting filesystems
 Name: autofs
 Version: 5.0.7
-Release: 23%{?dist}
+Release: 24%{?dist}
 Epoch: 1
 License: GPLv2+
 Group: System Environment/Daemons
@@ -94,6 +94,8 @@ Patch78: autofs-5.0.7-add-changlog-entry-for-coverity-fixes.patch
 Patch79: autofs-5.0.7-fix-probe-each-nfs-version-in-turn-for-singleton-mounts.patch
 Patch80: autofs-5.0.7-misc-man-page-fixes.patch
 Patch81: autofs-5.0.7-fix-add-null-check-in-parse_server_string.patch
+Patch82: autofs-5.0.7-check-for-protocol-option.patch
+Patch83: autofs-5.0.7-use-ulimit-max-open-files-if-greater-than-internal-maximum.patch
 Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 %if %{with_systemd}
 BuildRequires: systemd-units
@@ -232,6 +234,8 @@ echo %{version}-%{release} > .version
 %patch79 -p1
 %patch80 -p1
 %patch81 -p1
+%patch82 -p1
+%patch83 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -323,6 +327,10 @@ fi
 %dir /etc/auto.master.d
 
 %changelog
+* Wed Jul 10 2013 Ian Kent <ikent at redhat.com> - 1:5.0.7-24
+- check for protocol option.
+- use ulimit max open files if greater than internal maximum.
+
 * Fri Jun 28 2013 Ian Kent <ikent at redhat.com> - 1:5.0.7-23
 - fix add null check in parse_server_string() (bz979155).
 


More information about the scm-commits mailing list