All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Michael Orlov <orlovm@cs.bgu.ac.il>
Cc: autofs@linux.kernel.org
Subject: Re: autofs 5.0.4 and 5.0.5 do not remove ghost entries upon SIGHUP
Date: Thu, 13 Jan 2011 17:16:42 +0800	[thread overview]
Message-ID: <1294910202.2757.46.camel@perseus> (raw)
In-Reply-To: <1294905042.2757.42.camel@perseus>

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,

  reply	other threads:[~2011-01-13  9:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1294910202.2757.46.camel@perseus \
    --to=raven@themaw.net \
    --cc=autofs@linux.kernel.org \
    --cc=orlovm@cs.bgu.ac.il \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.