On 2019-12-12 21:18, Ian Kent wrote:
I think this is what should be done.
Could you check and see if it behaves as required please, of course
the CHANGELOG hunk needs to be dropped.
I haven't noticed any new issues after applying the third hunk (second
hunk being identical to what I already was testing).
Still recovers after a failure. I'll roll it out locally to the rest of
my systems and see if anything crops up.
Doug
autofs-5.1.6 - fix program map multi-mount lookup after mount fail
From: Ian Kent <raven@xxxxxxxxxx>
For the case of a singleton multi-mount program map lookup following
a mount fail (and the negative timeout has passed) the lookup key is
what's expected for an indirect map key but the the root offset map
entry already exists. This causes autofs to think it has an incorrect
lookup key and it fails the lookup when it should take the opptunity
to delete and update the cache entry since it's not actually in use
yet.
Also, if a check is done to see if the lookup is for the root offset,
deleting the entry fails because it contains an offset so it doesn't
get updated.
Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
CHANGELOG | 1 +
modules/lookup_program.c | 7 +++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/CHANGELOG b/CHANGELOG
index 981a0333..3c784d34 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
xx/xx/2020 autofs-5.1.7
- make bind mounts propagation slave by default.
- update ldap READMEs and schema definitions.
+- fix program map multi-mount lookup after mount fail.
07/10/2019 autofs-5.1.6
- support strictexpire mount option.
diff --git a/modules/lookup_program.c b/modules/lookup_program.c
index fcb1af74..ca209488 100644
--- a/modules/lookup_program.c
+++ b/modules/lookup_program.c
@@ -646,7 +646,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
name_len, ent, ctxt->parse->context);
goto out_free;
} else {
- if (me->multi) {
+ if (me->multi && me->multi != me) {
cache_unlock(mc);
warn(ap->logopt, MODPREFIX
"unexpected lookup for active multi-mount"
@@ -656,8 +656,11 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void *
cache_unlock(mc);
cache_writelock(mc);
me = cache_lookup_distinct(mc, name);
- if (me)
+ if (me) {
+ if (me->multi)
+ cache_delete_offset_list(mc, name);
cache_delete(mc, name);
+ }
cache_unlock(mc);
}
}