* [PATCH] autofs4 - bad lookup fix
@ 2005-06-04 8:12 raven
2005-06-09 18:26 ` Jeff Moyer
0 siblings, 1 reply; 2+ messages in thread
From: raven @ 2005-06-04 8:12 UTC (permalink / raw)
To: Andrew Morton
Cc: Steinar H. Gunderson, linux-fsdevel, Jeff Moyer,
Michael Blandford, Kernel Mailing List
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",
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] autofs4 - bad lookup fix
2005-06-04 8:12 [PATCH] autofs4 - bad lookup fix raven
@ 2005-06-09 18:26 ` Jeff Moyer
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Moyer @ 2005-06-09 18:26 UTC (permalink / raw)
To: raven
Cc: Andrew Morton, Steinar H. Gunderson, linux-fsdevel,
Michael Blandford, Kernel Mailing List
==> Regarding [PATCH] autofs4 - bad lookup fix; raven@themaw.net adds:
raven> For browsable autofs maps, a mount request that arrives at the same
raven> time an expire is happening can fail to perform the needed mount.
raven> This happens becuase the directory exists and so the revalidate
raven> succeeds when we need it to fail so that lookup is called on the
raven> same dentry to do the mount. Instead lookup is called on the next
raven> path component which should be whithin the mount, but the parent
raven> isn't mounted.
raven> The solution is to allow the revalidate to continue and perform the
raven> mount as no directory creation (at mount time) is needed for
raven> browsable mount entries.
I have a reproducer case for this, and the patch provided fixes it in my
environment.
-Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-06-09 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-04 8:12 [PATCH] autofs4 - bad lookup fix raven
2005-06-09 18:26 ` Jeff Moyer
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).