lkml.org 
[lkml]   [2005]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] autofs4 - post expire race fix

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 ) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-06-04 09:54    [W:0.038 / U:0.688 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site