linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: raven@themaw.net
To: Andrew Morton <akpm@osdl.org>
Cc: "Steinar H. Gunderson" <sgunderson@bigfoot.com>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	Jeff Moyer <jmoyer@redhat.com>,
	Michael Blandford <michael@kmaclub.com>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] autofs4 - bad lookup fix
Date: Sat, 4 Jun 2005 16:12:29 +0800 (WST)	[thread overview]
Message-ID: <Pine.LNX.4.62.0506041543090.8502@donald.themaw.net> (raw)


For browsable autofs maps, a mount request that arrives at the same time 
an expire is happening can fail to perform the needed mount.

This happens becuase the directory exists and so the revalidate succeeds 
when we need it to fail so that lookup is called on the same dentry to do 
the mount. Instead lookup is called on the next path component which 
should be whithin the mount, but the parent isn't mounted. 

The solution is to allow the revalidate to continue and perform the mount 
as no directory creation (at mount time) is needed for browsable mount 
entries.


diff -Nurp linux-2.6.12-rc5-mm1.orig/fs/autofs4/root.c linux-2.6.12-rc5-mm1/fs/autofs4/root.c
--- linux-2.6.12-rc5-mm1.orig/fs/autofs4/root.c	2005-05-29 14:46:30.000000000 +0800
+++ linux-2.6.12-rc5-mm1/fs/autofs4/root.c	2005-05-29 14:47:04.000000000 +0800
@@ -306,7 +306,14 @@ static int try_to_fill_dentry(struct den
 		
 		DPRINTK("expire done status=%d", status);
 		
-		return 0;
+		/*
+		 * If the directory still exists the mount request must
+		 * continue otherwise it can't be followed at the right
+		 * time during the walk.
+		 */
+		status = d_invalidate(dentry);
+		if (status != -EBUSY)
+			return 0;
 	}
 
 	DPRINTK("dentry=%p %.*s ino=%p",

             reply	other threads:[~2005-06-04  8:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-04  8:12 raven [this message]
2005-06-09 18:26 ` [PATCH] autofs4 - bad lookup fix Jeff Moyer

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=Pine.LNX.4.62.0506041543090.8502@donald.themaw.net \
    --to=raven@themaw.net \
    --cc=akpm@osdl.org \
    --cc=jmoyer@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@kmaclub.com \
    --cc=sgunderson@bigfoot.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).