]>
Commit | Line | Data |
---|---|---|
e5fd101c PS |
1 | autofs-5.0.4 - library reload fix update fix |
2 | ||
3 | From: Ian Kent <raven@themaw.net> | |
4 | ||
5 | The library reload fixes introduced a bug which causes autofs to | |
6 | incorrectly shutdown. Previously the signal handling thread only | |
7 | recieved signals either when they were explicity sent or it was | |
8 | time to shutdown so continuing on to call the signal handling | |
9 | routine was the correct thing to do. Now we need to join with | |
10 | the mount handling thread at exit but, in this case, we don't | |
11 | want to continue on to the signal handling routine as that will | |
12 | incorrectly cause the signal to be passed on to other mount | |
13 | handling 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 | ||
22 | diff --git a/CHANGELOG b/CHANGELOG | |
23 | index 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 | ----------------------- | |
34 | diff --git a/daemon/automount.c b/daemon/automount.c | |
35 | index 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; | |
63 | diff --git a/lib/master.c b/lib/master.c | |
64 | index 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 | } |