1 autofs-5.0.4 - mannual umount recovery fixes
3 From: Ian Kent <raven@themaw.net>
5 Check for the absence of a mount before doing the manual umount
6 checks and check ioctlfd is valid seperately. Take a write lock
7 on the map entry mutex to ensure any mount request is complete
12 daemon/direct.c | 4 ++--
13 daemon/indirect.c | 37 +++++++++++++++++++++++--------------
14 3 files changed, 26 insertions(+), 16 deletions(-)
17 diff --git a/CHANGELOG b/CHANGELOG
18 index f0d0e58..05e0206 100644
22 - fix notify mount message path.
23 - remount we created mount point fix.
24 - fix double free in sasl_bind().
25 +- mannual umount recovery fixes.
27 4/11/2008 autofs-5.0.4
28 -----------------------
29 diff --git a/daemon/direct.c b/daemon/direct.c
30 index 74a9acc..7b02c7a 100644
33 @@ -889,9 +889,9 @@ void *expire_proc_direct(void *arg)
34 /* Check for manual umount */
35 cache_writelock(me->mc);
36 if (me->ioctlfd != -1 &&
37 - fstat(ioctlfd, &st) != -1 &&
38 + fstat(me->ioctlfd, &st) != -1 &&
39 !count_mounts(ap->logopt, next->path, st.st_dev)) {
40 - ops->close(ap->logopt, ioctlfd);
41 + ops->close(ap->logopt, me->ioctlfd);
44 pthread_setcancelstate(cur_state, NULL);
45 diff --git a/daemon/indirect.c b/daemon/indirect.c
46 index 463b39c..8025ee4 100644
47 --- a/daemon/indirect.c
48 +++ b/daemon/indirect.c
49 @@ -437,7 +437,19 @@ void *expire_proc_indirect(void *arg)
50 struct mapent *me = NULL;
53 - master_source_readlock(ap->entry);
54 + /* It's got a mount, deal with in the outer loop */
55 + if (is_mounted(_PATH_MOUNTED, next->path, MNTS_REAL)) {
56 + pthread_setcancelstate(cur_state, NULL);
60 + /* Don't touch submounts */
61 + if (master_find_submount(ap, next->path)) {
62 + pthread_setcancelstate(cur_state, NULL);
66 + master_source_writelock(ap->entry);
68 map = ap->entry->maps;
70 @@ -456,20 +468,17 @@ void *expire_proc_indirect(void *arg)
74 + if (me->ioctlfd == -1) {
76 + master_source_unlock(ap->entry);
77 + pthread_setcancelstate(cur_state, NULL);
81 /* Check for manual umount */
82 - if (me->ioctlfd != -1 &&
83 - (fstat(me->ioctlfd, &st) == -1 ||
84 - !count_mounts(ap->logopt, me->key, st.st_dev))) {
85 - if (is_mounted(_PROC_MOUNTS, me->key, MNTS_REAL)) {
87 - "error: possible mtab mismatch %s",
90 - master_source_unlock(ap->entry);
91 - pthread_setcancelstate(cur_state, NULL);
95 + if (fstat(me->ioctlfd, &st) == -1 ||
96 + !count_mounts(ap->logopt, me->key, st.st_dev)) {
97 + ops->close(ap->logopt, me->ioctlfd);