Re: Failure of program map to recover after failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


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.


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

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(-)

index 981a0333..3c784d34 100644
@@ -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) {
  				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 *
  			me = cache_lookup_distinct(mc, name);
-			if (me)
+			if (me) {
+				if (me->multi)
+					cache_delete_offset_list(mc, name);
  				cache_delete(mc, name);
+			}

[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux