Date: Tue, 19 Sep 2006 11:21:33 +0800 From: Ian Kent <ikent@redhat.com> Subject: [RHEL 5 PATCH 2/2] autofs4 fixes Hi all, Recent testing of autofs version 5 turned up a couple of problems. Since these patches won't make it into 2.6.18 I recommend we add them to the RHEL5 kernel. I have logged BZ 206952 to tract this. Here is the second of the two patches. During testing I've found that the mount pending flag can be left set at exit from autofs4_lookup after a failed mount request. This shouldn't be allowed to happen and causes incorrect error returns. Signed-off-by: Ian Kent <raven@themaw.net> -- --- linux-2.6.18-rc4-mm2/fs/autofs4/root.c.clear-pending 2006-08-20 13:20:23.000000000 +0800 +++ linux-2.6.18-rc4-mm2/fs/autofs4/root.c 2006-08-20 13:21:30.000000000 +0800 @@ -281,9 +281,6 @@ static int try_to_fill_dentry(struct den DPRINTK("mount done status=%d", status); - if (status && dentry->d_inode) - return status; /* Try to get the kernel to invalidate this dentry */ - /* Turn this into a real negative dentry? */ if (status == -ENOENT) { spin_lock(&dentry->d_lock); @@ -540,6 +537,9 @@ static struct dentry *autofs4_lookup(str return ERR_PTR(-ERESTARTNOINTR); } } + spin_lock(&dentry->d_lock); + dentry->d_flags &= ~DCACHE_AUTOFS_PENDING; + spin_unlock(&dentry->d_lock); } /* Date: Tue, 19 Sep 2006 11:18:45 +0800 From: Ian Kent <ikent@redhat.com> Subject: [RHEL 5 PATCH 1/2] autofs4 fixes Hi all, Recent testing of autofs version 5 turned up a couple of problems. Since these patches won't make it into 2.6.18 I recommend we add them to the RHEL5 kernel. I have logged BZ 206952 to tract this. Here is the first of the two patches. The check for an empty directory in the autofs4_follow_link method fails occassionally due to old dentrys. We had the same problem autofs4_revalidate ages ago. I thought we wouldn't need this in autofs4_follow_link, silly me. Signed-off-by: Ian Kent <raven@themaw.net> -- --- linux-2.6.18-rc4-mm1/fs/autofs4/root.c.follow_link-false-negative 2006-08-14 10:13:59.000000000 +0800 +++ linux-2.6.18-rc4-mm1/fs/autofs4/root.c 2006-08-14 10:15:26.000000000 +0800 @@ -359,7 +359,7 @@ static void *autofs4_follow_link(struct * don't try to mount it again. */ spin_lock(&dcache_lock); - if (!d_mountpoint(dentry) && list_empty(&dentry->d_subdirs)) { + if (!d_mountpoint(dentry) && __simple_empty(dentry)) { spin_unlock(&dcache_lock); status = try_to_fill_dentry(dentry, 0);