]> git.pld-linux.org Git - packages/autofs.git/blame - autofs-5.0.4-fix-st_remove_tasks-locking.patch
- updated to 5.0.5, nfy.
[packages/autofs.git] / autofs-5.0.4-fix-st_remove_tasks-locking.patch
CommitLineData
e5fd101c
PS
1autofs-5.0.4 - fix st_remove_tasks() locking
2
3From: Ian Kent <raven@themaw.net>
4
5The autofs serialization of state changing during task (mount, umount etc.)
6execution was being done twice, with the state queue manager and by using
7a pipe to communicate state changes to the handle_mounts() thread. This
8required the use of two mutexes which was unnecessary and problematic. So
9the pipe was removed and the state queue alone now handles this. When this
10was done most of the state queue locking was moved into the state queue
11manager functions, however, the locking was inadvertantly left out of the
12st_remove_tasks() function.
13---
14
15 CHANGELOG | 1 +
16 daemon/state.c | 8 +++++++-
17 2 files changed, 8 insertions(+), 1 deletions(-)
18
19
20diff --git a/CHANGELOG b/CHANGELOG
21index 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 -----------------------
32diff --git a/daemon/state.c b/daemon/state.c
33index 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
This page took 0.107731 seconds and 4 git commands to generate.