]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.4-library-reload-fix-update-fix.patch
- updated to 5.0.5, nfy.
[packages/autofs.git] / autofs-5.0.4-library-reload-fix-update-fix.patch
CommitLineData
e5fd101c
PS
1autofs-5.0.4 - library reload fix update fix
2
3From: Ian Kent <raven@themaw.net>
4
5The library reload fixes introduced a bug which causes autofs to
6incorrectly shutdown. Previously the signal handling thread only
7recieved signals either when they were explicity sent or it was
8time to shutdown so continuing on to call the signal handling
9routine was the correct thing to do. Now we need to join with
10the mount handling thread at exit but, in this case, we don't
11want to continue on to the signal handling routine as that will
12incorrectly cause the signal to be passed on to other mount
13handling threads.
14---
15
16 CHANGELOG | 1 +
17 daemon/automount.c | 18 ++++++++++++++++--
18 lib/master.c | 2 --
19 3 files changed, 17 insertions(+), 4 deletions(-)
20
21
22diff --git a/CHANGELOG b/CHANGELOG
23index 7ca45fd..5e01812 100644
24--- a/CHANGELOG
25+++ b/CHANGELOG
26@@ -44,6 +44,7 @@
27 - use intr option as hosts mount default.
28 - fix kernel includes.
29 - dont umount existing direct mount on master re-read.
30+- fix incorrect shutdown introduced by library relaod fixes.
31
32 4/11/2008 autofs-5.0.4
33 -----------------------
34diff --git a/daemon/automount.c b/daemon/automount.c
35index 80691fa..3a0fe0b 100644
36--- a/daemon/automount.c
37+++ b/daemon/automount.c
38@@ -1332,8 +1332,22 @@ static void *statemachine(void *arg)
39 case SIGTERM:
40 case SIGINT:
41 case SIGUSR2:
42- if (master_done(master_list))
43- return NULL;
44+ master_mutex_lock();
45+ if (list_empty(&master_list->completed)) {
46+ if (list_empty(&master_list->mounts)) {
47+ master_mutex_unlock();
48+ return NULL;
49+ }
50+ } else {
51+ if (master_done(master_list)) {
52+ master_mutex_unlock();
53+ return NULL;
54+ }
55+ master_mutex_unlock();
56+ break;
57+ }
58+ master_mutex_unlock();
59+
60 case SIGUSR1:
61 do_signals(master_list, sig);
62 break;
63diff --git a/lib/master.c b/lib/master.c
64index 762094f..e43f835 100644
65--- a/lib/master.c
66+++ b/lib/master.c
67@@ -1182,7 +1182,6 @@ int master_done(struct master *master)
68 struct master_mapent *entry;
69 int res = 0;
70
71- master_mutex_lock();
72 head = &master->completed;
73 p = head->next;
74 while (p != head) {
75@@ -1195,7 +1194,6 @@ int master_done(struct master *master)
76 }
77 if (list_empty(&master->mounts))
78 res = 1;
79- master_mutex_unlock();
80
81 return res;
82 }
This page took 0.044872 seconds and 4 git commands to generate.