rpms/autofs/FC-6 autofs-5.0.1-rc3-task-done-race-2.patch, NONE, 1.1 autofs.spec, 1.170, 1.171 autofs-5.0.1-rc3-task-done-race.patch, 1.1, NONE
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Mon Feb 12 02:31:01 UTC 2007
Author: ikent
Update of /cvs/dist/rpms/autofs/FC-6
In directory cvs.devel.redhat.com:/tmp/cvs-serv11882
Modified Files:
autofs.spec
Added Files:
autofs-5.0.1-rc3-task-done-race-2.patch
Removed Files:
autofs-5.0.1-rc3-task-done-race.patch
Log Message:
* Sat Feb 10 2007 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc3.16
- update the "task done race" patch to fix a deadlock.
autofs-5.0.1-rc3-task-done-race-2.patch:
CHANGELOG | 1 +
daemon/state.c | 30 +++++-------------------------
2 files changed, 6 insertions(+), 25 deletions(-)
--- NEW FILE autofs-5.0.1-rc3-task-done-race-2.patch ---
diff --git a/CHANGELOG b/CHANGELOG
index 48b959a..bdedbf5 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,7 @@
- make double quote handing consistent.
- fix handling of trailing white space in wildcard lookup.
- check fqdn of each interface when matching export access list.
+- fix race when setting task done.
4/1/2007 autofs-5.0.1 rc3
-------------------------
diff --git a/daemon/state.c b/daemon/state.c
index d5eca8b..2fa78aa 100644
--- a/daemon/state.c
+++ b/daemon/state.c
@@ -190,10 +190,10 @@ void expire_cleanup(void *arg)
if (next != ST_INVAL)
nextstate(statefd, next);
- state_mutex_unlock(ap);
-
st_set_done(ap);
+ state_mutex_unlock(ap);
+
return;
}
@@ -326,11 +326,10 @@ static void do_readmap_cleanup(void *arg)
state_mutex_lock(ap);
nextstate(ap->state_pipe[1], ST_READY);
+ st_set_done(ap);
state_mutex_unlock(ap);
- st_set_done(ap);
-
if (!ap->submount)
alarm_add(ap, ap->exp_runfreq);
@@ -480,10 +479,6 @@ static unsigned int st_readmap(struct autofs_point *ap)
assert(ap->state == ST_READY);
assert(ap->readmap_thread == 0);
- /* Turn off timeouts for this mountpoint */
- if (!ap->submount)
- alarm_delete(ap);
-
ap->state = ST_READMAP;
ra = malloc(sizeof(struct readmap_args));
@@ -549,10 +544,6 @@ static unsigned int st_prepare_shutdown(struct autofs_point *ap)
debug(ap->logopt, "state %d path %s", ap->state, ap->path);
- /* Turn off timeouts for this mountpoint */
- if (!ap->submount)
- alarm_delete(ap);
-
assert(ap->state == ST_READY || ap->state == ST_EXPIRE);
ap->state = ST_SHUTDOWN_PENDING;
@@ -579,10 +570,6 @@ static unsigned int st_force_shutdown(struct autofs_point *ap)
debug(ap->logopt, "state %d path %s", ap->state, ap->path);
- /* Turn off timeouts for this mountpoint */
- if (!ap->submount)
- alarm_delete(ap);
-
assert(ap->state == ST_READY || ap->state == ST_EXPIRE);
ap->state = ST_SHUTDOWN_FORCE;
@@ -610,10 +597,6 @@ static unsigned int st_prune(struct autofs_point *ap)
assert(ap->state == ST_READY);
ap->state = ST_PRUNE;
- /* Turn off timeouts while we prune */
- if (!ap->submount)
- alarm_delete(ap);
-
switch (expire_proc(ap, 1)) {
case EXP_ERROR:
case EXP_PARTIAL:
@@ -635,10 +618,6 @@ static unsigned int st_expire(struct autofs_point *ap)
assert(ap->state == ST_READY);
ap->state = ST_EXPIRE;
- /* Turn off timeouts while we expire */
- if (!ap->submount)
- alarm_delete(ap);
-
switch (expire_proc(ap, 0)) {
case EXP_ERROR:
case EXP_PARTIAL:
@@ -723,7 +702,7 @@ int st_add_task(struct autofs_point *ap, enum states state)
empty = 0;
/* Don't add duplicate tasks */
- if (task->state == state ||
+ if ((task->state == state && !task->done) ||
(ap_state == ST_SHUTDOWN_PENDING ||
ap_state == ST_SHUTDOWN_FORCE))
break;
@@ -888,6 +867,7 @@ static void st_set_thid(struct autofs_point *ap, pthread_t thid)
return;
}
+/* Requires state mutex to be held */
static void st_set_done(struct autofs_point *ap)
{
struct list_head *p, *head;
Index: autofs.spec
===================================================================
RCS file: /cvs/dist/rpms/autofs/FC-6/autofs.spec,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -r1.170 -r1.171
--- autofs.spec 6 Feb 2007 01:19:17 -0000 1.170
+++ autofs.spec 12 Feb 2007 02:30:59 -0000 1.171
@@ -4,7 +4,7 @@
Summary: A tool for automatically mounting and unmounting filesystems
Name: autofs
%define version 5.0.1
-%define release 0.rc3.14
+%define release 0.rc3.16
Version: %{version}
Release: %{release}
Epoch: 1
@@ -19,7 +19,7 @@
Patch6: autofs-5.0.1-rc3-consistent-dquote-handling.patch
Patch7: autofs-5.0.1-rc3-trailing-whitespace.patch
Patch8: autofs-5.0.1-rc3-match-export-fqdn.patch
-Patch9: autofs-5.0.1-rc3-task-done-race.patch
+Patch9: autofs-5.0.1-rc3-task-done-race-2.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
@@ -127,6 +127,9 @@
%{_libdir}/autofs/*
%changelog
+* Sat Feb 10 2007 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc3.16
+- update the "task done race" patch to fix a deadlock.
+
* Tue Feb 6 2007 Ian Kent <ikent at redhat.com> - 5.0.1-0.rc3.14
- fix race when setting task done (bz 227268).
--- autofs-5.0.1-rc3-task-done-race.patch DELETED ---
More information about the fedora-cvs-commits
mailing list