rpms/autofs/devel autofs-5.0.1-alarm-deadlock.patch, NONE, 1.1 autofs.spec, 1.202, 1.203

Ian Kent (iankent) fedora-extras-commits at redhat.com
Thu Jun 7 07:52:58 UTC 2007


Author: iankent

Update of /cvs/pkgs/rpms/autofs/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv16178

Modified Files:
	autofs.spec 
Added Files:
	autofs-5.0.1-alarm-deadlock.patch 
Log Message:
* Thu Jun 7 2007 Ian Kent <ikent at redhat.com> - 5.0.1-14
- fix deadlock in alarm manager module.


autofs-5.0.1-alarm-deadlock.patch:

--- NEW FILE autofs-5.0.1-alarm-deadlock.patch ---
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(&current->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(&current->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;
 		}
 	}


Index: autofs.spec
===================================================================
RCS file: /cvs/pkgs/rpms/autofs/devel/autofs.spec,v
retrieving revision 1.202
retrieving revision 1.203
diff -u -r1.202 -r1.203
--- autofs.spec	3 Jun 2007 15:31:03 -0000	1.202
+++ autofs.spec	7 Jun 2007 07:52:23 -0000	1.203
@@ -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 @@
 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 @@
 %patch17 -p1
 %patch18 -p1
 %patch19 -p1
+%patch20 -p1
 
 %build
 #CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --libdir=%{_libdir}
@@ -141,6 +143,9 @@
 %{_libdir}/autofs/
 
 %changelog
+* Thu Jun 7 2007 Ian Kent <ikent at redhat.com> - 5.0.1-14
+- fix deadlock in alarm manager module.
+
 * Sun Jun 3 2007 Ian Kent <ikent at redhat.com> - 5.0.1-12
 - correct mistake in logic test in wildcard lookup.
 




More information about the fedora-extras-commits mailing list