From d7489ff43a6ae70c45dfb005998213a055767ae8 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Jul 10 2013 01:51:09 +0000 Subject: - 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. --- 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 + +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 + +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 53b2507..543f745 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 - 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 - 1:5.0.7-23 - fix add null check in parse_server_string() (bz979155).