All of lore.kernel.org
 help / color / mirror / Atom feed
* autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
@ 2010-10-27 21:35 Michael Orlov
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Orlov @ 2010-10-27 21:35 UTC (permalink / raw)
  To: autofs

Hi,

I think this is a bug - if it is not, I will be glad if someone
corrects me. I am using autofs on Gentoo.

In auto.master, put
  /mnt/test  /etc/auto.test  --ghost

In auto.test, put
  floppy -fstype=auto :/dev/fd0
(or anything similar)

1. start autofs
2. see that /mnt/test/floppy exists
3. remove / comment out the "floppy" line in auto.test
4. send SIGHUP to autofs

After these actions, in autofs 5.0.4 / 5.0.5 (but not
5.0.3), /mnt/test/floppy still exists - it is not removed after SIGHUP.

This is problematic, for example, when auto.test is maintained via
udev. Full restart of a service from a udev-invoked script is very
error-prone.

Thanks,
Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
@ 2011-01-11 16:34 Michael Orlov
  2011-01-13  7:50 ` Ian Kent
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Orlov @ 2011-01-11 16:34 UTC (permalink / raw)
  To: autofs

Hi,

(I have sent this message on Oct 27, but nothing appears in the
archives for that month - hopefully it's not a duplicate message.)

I think this is a bug - if it is not, I will be glad if someone
corrects me. I am using autofs on Gentoo.

In auto.master, put
  /mnt/test  /etc/auto.test  --ghost

In auto.test, put
  floppy -fstype=auto :/dev/fd0
(or anything similar)

1. start autofs
2. see that /mnt/test/floppy exists
3. remove or comment out the "floppy" line in auto.test
4. send SIGHUP to autofs

After these actions, in autofs 5.0.4 / 5.0.5 (but not
5.0.3), /mnt/test/floppy still exists - it is not removed after SIGHUP.

This is problematic, for example, when auto.test is maintained via
udev. Full restart of a service from a udev-invoked script is very
error-prone.

Thanks,
Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
  2011-01-11 16:34 autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP Michael Orlov
@ 2011-01-13  7:50 ` Ian Kent
  2011-01-13  9:16   ` Ian Kent
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Kent @ 2011-01-13  7:50 UTC (permalink / raw)
  To: Michael Orlov; +Cc: autofs

On Tue, 2011-01-11 at 18:34 +0200, Michael Orlov wrote:
> Hi,
> 
> (I have sent this message on Oct 27, but nothing appears in the
> archives for that month - hopefully it's not a duplicate message.)
> 
> I think this is a bug - if it is not, I will be glad if someone
> corrects me. I am using autofs on Gentoo.

You will need to duplicate this with all the current 5.0.5 patches on
kernel.org applied to get serious interest in this here.

> 
> In auto.master, put
>   /mnt/test  /etc/auto.test  --ghost
> 
> In auto.test, put
>   floppy -fstype=auto :/dev/fd0
> (or anything similar)
> 
> 1. start autofs
> 2. see that /mnt/test/floppy exists
> 3. remove or comment out the "floppy" line in auto.test
> 4. send SIGHUP to autofs
> 
> After these actions, in autofs 5.0.4 / 5.0.5 (but not
> 5.0.3), /mnt/test/floppy still exists - it is not removed after SIGHUP.
> 
> This is problematic, for example, when auto.test is maintained via
> udev. Full restart of a service from a udev-invoked script is very
> error-prone.
> 
> Thanks,
> Michael
> 
> _______________________________________________
> autofs mailing list
> autofs@linux.kernel.org
> http://linux.kernel.org/mailman/listinfo/autofs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
  2011-01-13  7:50 ` Ian Kent
@ 2011-01-13  9:16   ` Ian Kent
  2011-01-13 14:36     ` Michael Orlov
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Kent @ 2011-01-13  9:16 UTC (permalink / raw)
  To: Michael Orlov; +Cc: autofs

On Thu, 2011-01-13 at 15:50 +0800, Ian Kent wrote:
> On Tue, 2011-01-11 at 18:34 +0200, Michael Orlov wrote:
> > Hi,
> > 
> > (I have sent this message on Oct 27, but nothing appears in the
> > archives for that month - hopefully it's not a duplicate message.)
> > 
> > I think this is a bug - if it is not, I will be glad if someone
> > corrects me. I am using autofs on Gentoo.
> 
> You will need to duplicate this with all the current 5.0.5 patches on
> kernel.org applied to get serious interest in this here.

So I've done that and this patch seems to resolve the problem but I
doubt it will apply to the source you are using without some other
dependent patches from kernel.org.

autofs-5.0.5 - fix prune cache valid check

From: Ian Kent <raven@themaw.net>

During a map reload, when pruning the cache we look for a valid map entry
in another map. In lookup_prune_one_cache() There is a missing check for
the entry being in the current map which causes the directory cleanup code
from doing its job.
---

 daemon/lookup.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)


diff --git a/daemon/lookup.c b/daemon/lookup.c
index a9a1f4d..36e60c9 100644
--- a/daemon/lookup.c
+++ b/daemon/lookup.c
@@ -1060,6 +1060,14 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti
 		 * cache entry.
 		 */
 		valid = lookup_source_valid_mapent(ap, key, LKP_DISTINCT);
+		if (valid && valid->mc == mc) {
+			 /*
+			  * We've found a map entry that has been removed from
+			  * the current cache so it isn't really valid.
+			  */
+			cache_unlock(valid->mc);
+			valid = NULL;
+		}
 		if (!valid &&
 		    is_mounted(_PATH_MOUNTED, path, MNTS_REAL)) {
 			debug(ap->logopt,

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
  2011-01-13  9:16   ` Ian Kent
@ 2011-01-13 14:36     ` Michael Orlov
  2011-01-14  2:56       ` Ian Kent
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Orlov @ 2011-01-13 14:36 UTC (permalink / raw)
  To: autofs

> So I've done that and this patch seems to resolve the problem but I
> doubt it will apply to the source you are using without some other
> dependent patches from kernel.org.

Gentoo applies the patches listed in
http://kernel.org/pub/linux/daemons/autofs/v5/patch_order-5.0.5 - is
that what you mean?

> autofs-5.0.5 - fix prune cache valid check

Thanks! Will you be adding the patch to
http://kernel.org/pub/linux/daemons/autofs/v5/ ?

Bets regards,
Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
  2011-01-13 14:36     ` Michael Orlov
@ 2011-01-14  2:56       ` Ian Kent
  2011-01-14  7:23         ` Michael Orlov
  0 siblings, 1 reply; 7+ messages in thread
From: Ian Kent @ 2011-01-14  2:56 UTC (permalink / raw)
  To: Michael Orlov; +Cc: autofs

On Thu, 2011-01-13 at 16:36 +0200, Michael Orlov wrote:
> > So I've done that and this patch seems to resolve the problem but I
> > doubt it will apply to the source you are using without some other
> > dependent patches from kernel.org.
> 
> Gentoo applies the patches listed in
> http://kernel.org/pub/linux/daemons/autofs/v5/patch_order-5.0.5 - is
> that what you mean?

Yes, but there are a few others I have here.
The patches against this part of the code should all be available on
kernel.org so you should be OK.

> 
> > autofs-5.0.5 - fix prune cache valid check
> 
> Thanks! Will you be adding the patch to
> http://kernel.org/pub/linux/daemons/autofs/v5/ ?

Not until I get feedback as to whether it fixes the issue and a little
think time on my part.

Ian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
  2011-01-14  2:56       ` Ian Kent
@ 2011-01-14  7:23         ` Michael Orlov
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Orlov @ 2011-01-14  7:23 UTC (permalink / raw)
  To: Ian Kent; +Cc: autofs

> > Thanks! Will you be adding the patch to
> > http://kernel.org/pub/linux/daemons/autofs/v5/ ?
> 
> Not until I get feedback as to whether it fixes the issue and a little
> think time on my part.

I just tested on Gentoo's net-fs/autofs-5.0.5 +
fix-prune-cache-valid-check - works very well, both with the simple test
that I described previously, and with a full-blown udev-based
solution.

Best regards,
Michael

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-01-14  7:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-11 16:34 autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP Michael Orlov
2011-01-13  7:50 ` Ian Kent
2011-01-13  9:16   ` Ian Kent
2011-01-13 14:36     ` Michael Orlov
2011-01-14  2:56       ` Ian Kent
2011-01-14  7:23         ` Michael Orlov
  -- strict thread matches above, loose matches on Subject: below --
2010-10-27 21:35 Michael Orlov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.