From d35ca7c13df366dbff4d78feec6a5bca8bcf487b Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Jun 07 2007 07:52:23 +0000 Subject: - fix deadlock in alarm manager module. --- diff --git a/autofs-5.0.1-alarm-deadlock.patch b/autofs-5.0.1-alarm-deadlock.patch new file mode 100644 index 0000000..6153ee3 --- /dev/null +++ b/autofs-5.0.1-alarm-deadlock.patch @@ -0,0 +1,66 @@ +diff --git a/lib/alarm.c b/lib/alarm.c +index e0e6fd4..4a72605 100755 +--- a/lib/alarm.c ++++ b/lib/alarm.c +@@ -168,7 +168,6 @@ void alarm_delete(struct autofs_point *ap) + static void *alarm_handler(void *arg) + { + struct list_head *head; +- struct autofs_point *ap; + struct timespec expire; + time_t now; + int status; +@@ -192,10 +191,11 @@ static void *alarm_handler(void *arg) + + current = list_entry(head->next, struct alarm, list); + +- ap = current->ap; + now = time(NULL); + + if (current->time <= now) { ++ struct autofs_point *ap; ++ + list_del(¤t->list); + + if (current->cancel) { +@@ -203,11 +203,15 @@ static void *alarm_handler(void *arg) + continue; + } + ++ ap = current->ap; ++ free(current); ++ alarm_unlock(); ++ + state_mutex_lock(ap); + nextstate(ap->state_pipe[1], ST_EXPIRE); + state_mutex_unlock(ap); + +- free(current); ++ alarm_lock(); + continue; + } + +@@ -215,6 +219,7 @@ static void *alarm_handler(void *arg) + expire.tv_nsec = 0; + + while (1) { ++ struct autofs_point *ap; + struct alarm *next; + + status = pthread_cond_timedwait(&cond, &mutex, &expire); +@@ -232,12 +237,15 @@ static void *alarm_handler(void *arg) + break; + + list_del(¤t->list); ++ ap = current->ap; + free(current); ++ alarm_unlock(); + + state_mutex_lock(ap); + nextstate(ap->state_pipe[1], ST_EXPIRE); + state_mutex_unlock(ap); + ++ alarm_lock(); + break; + } + } diff --git a/autofs.spec b/autofs.spec index dc2b2fd..f2edc11 100644 --- a/autofs.spec +++ b/autofs.spec @@ -4,7 +4,7 @@ Summary: A tool for automatically mounting and unmounting filesystems Name: autofs Version: 5.0.1 -Release: 12 +Release: 14 Epoch: 1 License: GPL Group: System Environment/Daemons @@ -29,6 +29,7 @@ Patch16: autofs-5.0.1-disable-exports-check.patch Patch17: autofs-5.0.1-cmd-global-options-fix.patch Patch18: autofs-5.0.1-allow-dot-in-master-macro.patch Patch19: autofs-5.0.1-correct-logic-test-wild-lookup.patch +Patch20: autofs-5.0.1-alarm-deadlock.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, libxml2-devel, cyrus-sasl-devel, openssl-devel Conflicts: kernel < 2.6.17 @@ -89,6 +90,7 @@ echo %{version}-%{release} > .version %patch17 -p1 %patch18 -p1 %patch19 -p1 +%patch20 -p1 %build #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir} @@ -141,6 +143,9 @@ fi %{_libdir}/autofs/ %changelog +* Thu Jun 7 2007 Ian Kent - 5.0.1-14 +- fix deadlock in alarm manager module. + * Sun Jun 3 2007 Ian Kent - 5.0.1-12 - correct mistake in logic test in wildcard lookup.