linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] autofs4 - post expire race fix
@ 2005-06-04  7:40 raven
  2005-06-16  0:07 ` Jeff Moyer
  0 siblings, 1 reply; 2+ messages in thread
From: raven @ 2005-06-04  7:40 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Michael Blandford, linux-fsdevel, Jeff Moyer,
	Steinar H. Gunderson, Kernel Mailing List


At the tail end of an expire it's possible for a process to enter
autofs4_wait, with a waitq type of NFY_NONE but find that the expire
is finished. In this cause autofs4_wait will try to create a new wait but 
not notify the daemon leading to a hang. As the wait type is meant to 
delay mount requests from revalidate or lookup during an expire and the 
expire is done all we need to do is check if the dentry is a mountpoint. 
If it's not then we're done.


diff -Nur linux-2.6.12-rc2-mm3.orig/fs/autofs4/waitq.c linux-2.6.12-rc2-mm3/fs/autofs4/waitq.c
--- linux-2.6.12-rc2-mm3.orig/fs/autofs4/waitq.c	2005-05-01 17:04:49.000000000 +0800
+++ linux-2.6.12-rc2-mm3/fs/autofs4/waitq.c	2005-05-01 17:07:18.000000000 +0800
@@ -191,6 +191,13 @@
 	}
 
 	if ( !wq ) {
+		/* Can't wait for an expire if there's no mount */
+		if (notify == NFY_NONE && !d_mountpoint(dentry)) {
+			kfree(name);
+			up(&sbi->wq_sem);
+			return -ENOENT;
+		}
+
 		/* Create a new wait queue */
 		wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL);
 		if ( !wq ) {

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

* Re: [PATCH] autofs4 - post expire race fix
  2005-06-04  7:40 [PATCH] autofs4 - post expire race fix raven
@ 2005-06-16  0:07 ` Jeff Moyer
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Moyer @ 2005-06-16  0:07 UTC (permalink / raw)
  To: raven
  Cc: Andrew Morton, Michael Blandford, linux-fsdevel,
	Steinar H. Gunderson, Kernel Mailing List

==> Regarding [PATCH] autofs4 - post expire race fix; raven@themaw.net adds:

raven> At the tail end of an expire it's possible for a process to enter
raven> autofs4_wait, with a waitq type of NFY_NONE but find that the expire
raven> is finished. In this cause autofs4_wait will try to create a new
raven> wait but not notify the daemon leading to a hang. As the wait type
raven> is meant to delay mount requests from revalidate or lookup during an
raven> expire and the expire is done all we need to do is check if the
raven> dentry is a mountpoint. If it's not then we're done.

FWIW, this looks good to me.  (sorry for the late reply)

Thanks,

Jeff

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

end of thread, other threads:[~2005-06-16  0:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-04  7:40 [PATCH] autofs4 - post expire race fix raven
2005-06-16  0:07 ` 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).