==> Regarding [autofs] subdirs trying to be mounted when using ghosting; Johan 
van den Dorpe <[EMAIL PROTECTED]> adds:

johan.vandendorpe> Hi guys We're having a problem when trying to access a
johan.vandendorpe> subdir of an automount directory that isn't
johan.vandendorpe> mounted. Instead of looking up the mount entry for the
johan.vandendorpe> directory, a subdir is looked up instead. If the exact
johan.vandendorpe> dir of the entry is accessed, then it mounts fine.

Fixed by Ian in more recent kernels.  Patch was something like the
attached, though you'd do better to drop this part, I think:

-               return (dentry->d_time - jiffies <= AUTOFS_NEGATIVE_TIMEOUT);
+               return (dentry->d_time - jiffies <= 0);


-Jeff

diff -Nurp linux-2.6.12.orig/fs/autofs4/expire.c 
linux-2.6.12/fs/autofs4/expire.c
--- linux-2.6.12.orig/fs/autofs4/expire.c       2005-06-18 03:48:29.000000000 
+0800
+++ linux-2.6.12/fs/autofs4/expire.c    2005-10-09 15:11:37.000000000 +0800
@@ -177,7 +177,7 @@ resume:
                DPRINTK("dentry %p %.*s",
                        dentry, (int)dentry->d_name.len, dentry->d_name.name);
 
-               if (!list_empty(&dentry->d_subdirs)) {
+               if (!simple_empty_nolock(dentry)) {
                        this_parent = dentry;
                        goto repeat;
                }
@@ -269,7 +269,7 @@ static struct dentry *autofs4_expire(str
                        goto next;
                }
 
-               if ( simple_empty(dentry) )
+               if (simple_empty(dentry))
                        goto next;
 
                /* Case 2: tree mount, expire iff entire tree is not busy */
diff -Nurp linux-2.6.12.orig/fs/autofs4/root.c linux-2.6.12/fs/autofs4/root.c
--- linux-2.6.12.orig/fs/autofs4/root.c 2005-06-18 03:48:29.000000000 +0800
+++ linux-2.6.12/fs/autofs4/root.c      2005-10-09 15:52:04.000000000 +0800
@@ -386,13 +386,13 @@ static int autofs4_revalidate(struct den
 
        /* Negative dentry.. invalidate if "old" */
        if (dentry->d_inode == NULL)
-               return (dentry->d_time - jiffies <= AUTOFS_NEGATIVE_TIMEOUT);
+               return (dentry->d_time - jiffies <= 0);
 
        /* Check for a non-mountpoint directory with no contents */
        spin_lock(&dcache_lock);
        if (S_ISDIR(dentry->d_inode->i_mode) &&
            !d_mountpoint(dentry) && 
-           list_empty(&dentry->d_subdirs)) {
+           simple_empty_nolock(dentry)) {
                DPRINTK("dentry=%p %.*s, emptydir",
                         dentry, dentry->d_name.len, dentry->d_name.name);
                spin_unlock(&dcache_lock);

_______________________________________________
autofs mailing list
[email protected]
http://linux.kernel.org/mailman/listinfo/autofs

Reply via email to