]>
Commit | Line | Data |
---|---|---|
e5fd101c PS |
1 | autofs-5.0.4 - fix st_remove_tasks() locking |
2 | ||
3 | From: Ian Kent <raven@themaw.net> | |
4 | ||
5 | The autofs serialization of state changing during task (mount, umount etc.) | |
6 | execution was being done twice, with the state queue manager and by using | |
7 | a pipe to communicate state changes to the handle_mounts() thread. This | |
8 | required the use of two mutexes which was unnecessary and problematic. So | |
9 | the pipe was removed and the state queue alone now handles this. When this | |
10 | was done most of the state queue locking was moved into the state queue | |
11 | manager functions, however, the locking was inadvertantly left out of the | |
12 | st_remove_tasks() function. | |
13 | --- | |
14 | ||
15 | CHANGELOG | 1 + | |
16 | daemon/state.c | 8 +++++++- | |
17 | 2 files changed, 8 insertions(+), 1 deletions(-) | |
18 | ||
19 | ||
20 | diff --git a/CHANGELOG b/CHANGELOG | |
21 | index a143294..c8b88e4 100644 | |
22 | --- a/CHANGELOG | |
23 | +++ b/CHANGELOG | |
24 | @@ -37,6 +37,7 @@ | |
25 | - clear rpc client on lookup fail. | |
26 | - fix lsb init script header. | |
27 | - fix memory leak reading master map. | |
28 | +- fix st_remove_tasks() locking. | |
29 | ||
30 | 4/11/2008 autofs-5.0.4 | |
31 | ----------------------- | |
32 | diff --git a/daemon/state.c b/daemon/state.c | |
33 | index 417fde1..533e241 100644 | |
34 | --- a/daemon/state.c | |
35 | +++ b/daemon/state.c | |
36 | @@ -783,10 +783,14 @@ void st_remove_tasks(struct autofs_point *ap) | |
37 | struct state_queue *task, *waiting; | |
38 | int status; | |
39 | ||
40 | + st_mutex_lock(); | |
41 | + | |
42 | head = &state_queue; | |
43 | ||
44 | - if (list_empty(head)) | |
45 | + if (list_empty(head)) { | |
46 | + st_mutex_unlock(); | |
47 | return; | |
48 | + } | |
49 | ||
50 | p = head->next; | |
51 | while (p != head) { | |
52 | @@ -823,6 +827,8 @@ void st_remove_tasks(struct autofs_point *ap) | |
53 | if (status) | |
54 | fatal(status); | |
55 | ||
56 | + st_mutex_unlock(); | |
57 | + | |
58 | return; | |
59 | } | |
60 |