From 0a4b5ff7c54508c309858edec8a8fe42586d1bcf Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Apr 28 2013 06:35:57 +0000 Subject: - add two upstream bug fixes. --- diff --git a/autofs-5.0.7-fix-some-automount_8-typos.patch b/autofs-5.0.7-fix-some-automount_8-typos.patch new file mode 100644 index 0000000..5e84c6c --- /dev/null +++ b/autofs-5.0.7-fix-some-automount_8-typos.patch @@ -0,0 +1,45 @@ +autofs-5.0.7 - fix some automount(8) typos + +From: Ian Kent + +Fix a couple of spelling errors in the automount(8) man page +that have been around for a long time. +--- + CHANGELOG | 1 + + man/automount.8 | 4 ++-- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index d8e4049..488ad1e 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -37,6 +37,7 @@ + - fix libtirpc build option to require libtirpc-devel if needed. + - fix systemd unidir in spec file. + - document browse option in man page. ++- fix some automount(8) typos. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/man/automount.8 b/man/automount.8 +index dddebce..7cc32c5 100644 +--- a/man/automount.8 ++++ b/man/automount.8 +@@ -43,7 +43,7 @@ autofs managed mounts. + .TP + .I "\-d, \-\-debug" + Enables logging of general status and progress messages as well as +-debuging messages for all autofs managed mounts. ++debugging messages for all autofs managed mounts. + .TP + .I "\-Dvariable=value" + Define a global macro substitution variable. Global definitions +@@ -133,7 +133,7 @@ unused. If the force umount at exit option is used the filesystems + will be umounted but the mount will not be released by the kernel + until they are no longer in use by the processes that held them busy. + If automount managed filesystems are found mounted when autofs is +-started they will be recoverd unless they are no longer present in ++started they will be recovered unless they are no longer present in + the map in which case they need to umounted manually. + .P + If the option to disable the check to see if the daemon is already diff --git a/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch b/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch new file mode 100644 index 0000000..09ed383 --- /dev/null +++ b/autofs-5.0.7-fix-submount-tree-not-all-expiring.patch @@ -0,0 +1,70 @@ +autofs-5.0.7 - fix submount tree not all expiring + +From: Ian Kent + +Due to the change in the expire-specific-submount-only patch, sub-mounts +within an indirect mount that follow a submount (in the check order) won't +be expired if that submount is busy. +--- + CHANGELOG | 1 + + lib/master.c | 24 +++++++++++++++--------- + 2 files changed, 16 insertions(+), 9 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index f1ec1e5..4106e7f 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -39,6 +39,7 @@ + - document browse option in man page. + - fix some automount(8) typos. + - syncronize handle_mounts() shutdown. ++- fix submount tree not all expiring. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/lib/master.c b/lib/master.c +index a0e62f2..64dbcb1 100644 +--- a/lib/master.c ++++ b/lib/master.c +@@ -905,15 +905,24 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state + this = list_entry(p, struct autofs_point, mounts); + p = p->prev; + +- if (!master_submount_list_empty(this)) { +- mounts_mutex_unlock(ap); +- return master_notify_submount(this, path, state); +- } +- + /* path not the same */ + if (strcmp(this->path, path)) + continue; + ++ if (!master_submount_list_empty(this)) { ++ char *this_path = strdup(this->path); ++ if (this_path) { ++ mounts_mutex_unlock(ap); ++ master_notify_submount(this, path, state); ++ mounts_mutex_lock(ap); ++ if (!__master_find_submount(ap, this_path)) { ++ free(this_path); ++ continue; ++ } ++ free(this_path); ++ } ++ } ++ + /* Now we have found the submount we want to expire */ + + st_mutex_lock(); +@@ -959,10 +968,7 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state + st_mutex_lock(); + } + st_mutex_unlock(); +- mounts_mutex_unlock(ap); +- +- return ret; +- ++ break; + } + + mounts_mutex_unlock(ap); diff --git a/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch b/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch new file mode 100644 index 0000000..25b40aa --- /dev/null +++ b/autofs-5.0.7-syncronize-handle_mounts-shutdown.patch @@ -0,0 +1,73 @@ +autofs-5.0.7 - syncronize handle_mounts() shutdown + +From: Ian Kent + +When re-reading the master map the signal handler thread receives +a SIGTERM signal from handle_mounts_cleanup() for map entries that +have been removed. This is done to allow joining with handle_mounts() +threads before shutting down to ensure clean up has been completed +before the thread terminates. + +But, if more than one map entry is removed, multiple threads may be +cleaned up during the handling of a single signal so there can be no +work to do when a subsequent signal is received. In this case the +signal handler thread interprets the additional SIGTERM signal as a +request to shutdown and exits. +--- + CHANGELOG | 1 + + daemon/automount.c | 9 +++++++-- + 2 files changed, 8 insertions(+), 2 deletions(-) + +diff --git a/CHANGELOG b/CHANGELOG +index 488ad1e..f1ec1e5 100644 +--- a/CHANGELOG ++++ b/CHANGELOG +@@ -38,6 +38,7 @@ + - fix systemd unidir in spec file. + - document browse option in man page. + - fix some automount(8) typos. ++- syncronize handle_mounts() shutdown. + + 25/07/2012 autofs-5.0.7 + ======================= +diff --git a/daemon/automount.c b/daemon/automount.c +index 4c651cf..3f9337f 100644 +--- a/daemon/automount.c ++++ b/daemon/automount.c +@@ -1285,7 +1285,8 @@ static int do_hup_signal(struct master *master, time_t age) + nfs_mount_uses_string_options = check_nfs_mount_version(&vers, &check); + + master_mutex_lock(); +- if (master->reading) { ++ /* Already doing a map read or shutdown or no mounts */ ++ if (master->reading || list_empty(&master->mounts)) { + status = pthread_mutex_unlock(&mrc.mutex); + if (status) + fatal(status); +@@ -1449,6 +1450,7 @@ static void handle_mounts_cleanup(void *arg) + char path[PATH_MAX + 1]; + char buf[MAX_ERR_BUF]; + unsigned int clean = 0, submount, logopt; ++ unsigned int pending = 0; + + ap = (struct autofs_point *) arg; + +@@ -1466,6 +1468,9 @@ static void handle_mounts_cleanup(void *arg) + list_del_init(&ap->mounts); + } + ++ /* Don't signal the handler if we have already done so */ ++ if (!list_empty(&master_list->completed)) ++ pending = 1; + master_remove_mapent(ap->entry); + master_source_unlock(ap->entry); + +@@ -1498,7 +1503,7 @@ static void handle_mounts_cleanup(void *arg) + * so it can join with any completed handle_mounts() threads and + * perform final cleanup. + */ +- if (!submount) ++ if (!submount && !pending) + pthread_kill(state_mach_thid, SIGTERM); + + master_mutex_unlock(); diff --git a/autofs.spec b/autofs.spec index 5293aa7..6c4b93c 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: 12%{?dist} +Release: 14%{?dist} Epoch: 1 License: GPLv2+ Group: System Environment/Daemons @@ -54,6 +54,9 @@ Patch38: autofs-5.0.7-fix-libtirpc-build-option.patch Patch39: autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch Patch40: autofs-5.0.7-document-browse-option-in-man-page.patch Patch41: autofs-5.0.7-fix-automounter-support-on-parisc.patch +Patch42: autofs-5.0.7-fix-some-automount_8-typos.patch +Patch43: autofs-5.0.7-syncronize-handle_mounts-shutdown.patch +Patch44: autofs-5.0.7-fix-submount-tree-not-all-expiring.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_systemd} BuildRequires: systemd-units @@ -152,6 +155,9 @@ echo %{version}-%{release} > .version %patch39 -p1 %patch40 -p1 %patch41 -p1 +%patch42 -p1 +%patch43 -p1 +%patch44 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -243,6 +249,11 @@ fi %dir /etc/auto.master.d %changelog +* Sun Apr 28 2013 Ian Kent - 1:5.0.7-14 +- fix some automount(8) typos (bz664178). +- fix syncronize of handle_mounts() shutdown. +- fix submount tree not all expiring. + * Tue Mar 12 2013 Ian Kent - 1:5.0.7-12 - dont fail on master map self include. - fix wildcard multi map regression.