1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 01UPSTREAM_autofs-5.0.4-expire-specific-submount-only.dpatch
7
autofs-5.0.4 - expire specific submount only
9
From: Ian Kent <raven@themaw.net>
11
The submount shutdown at expire assumes that certain locks are not
12
held but when notifying submounts containing nested submounts not
13
all locks were being released. This leads to occassional deadlock
14
when child submounts attempt to shutdown.
18
lib/master.c | 33 ++++++++-------------------------
19
2 files changed, 9 insertions(+), 25 deletions(-)
22
diff --git a/CHANGELOG b/CHANGELOG
23
index 4e8209e..88ca579 100644
27
??/??/2009 autofs-5.0.5
28
-----------------------
29
- fix dumb libxml2 check
30
+- fix nested submount expire deadlock.
32
4/11/2008 autofs-5.0.4
33
-----------------------
34
diff --git a/lib/master.c b/lib/master.c
35
index a243e6a..e1cc062 100644
38
@@ -834,7 +834,6 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state
40
struct list_head *head, *p;
41
struct autofs_point *this = NULL;
42
- size_t plen = strlen(path);
45
mounts_mutex_lock(ap);
46
@@ -842,37 +841,19 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state
47
head = &ap->submounts;
52
this = list_entry(p, struct autofs_point, mounts);
55
if (!master_submount_list_empty(this)) {
56
- if (!master_notify_submount(this, path, state)) {
60
+ mounts_mutex_unlock(ap);
61
+ return master_notify_submount(this, path, state);
64
- len = strlen(this->path);
66
- /* Initial path not the same */
67
- if (strncmp(this->path, path, len))
68
+ /* path not the same */
69
+ if (strcmp(this->path, path))
73
- * Part of submount tree?
74
- * We must wait till we get to submount itself.
75
- * If it is tell caller by returning true.
78
- /* Not part of this directory tree */
79
- if (path[len] != '/')
84
- /* Now we have a submount to expire */
85
+ /* Now we have found the submount we want to expire */
89
@@ -901,8 +882,10 @@ int master_notify_submount(struct autofs_point *ap, const char *path, enum state
90
struct timespec t = { 0, 300000000 };
93
- if (this->state != ST_SHUTDOWN)
94
+ if (this->state != ST_SHUTDOWN) {
100
mounts_mutex_unlock(ap);