Re: 2.6.6-rc3-mm1

raven
2004-05-01T12:08:08Z

On Sat, 1 May 2004, Ian Kent wrote:

> On Fri, 30 Apr 2004, Andrew Morton wrote:
>
> >
> > - The autofs4 patch series may be ready to go. This is an invitation to
> > interested parties to submit their final review comments...
>
> Jeff Moyer has pointed out a couple of things that need to be
> checked.
>
> Hopefully I'll be able to post the result today.
>

Jeff noticed something else that was missing from the 2.4 -> 2.6
conversion (see below).

To all,

Looking at the code in fs/autofs4/waitq.c again, due to Jeff Moyers'
comments, I really think I've got the locking wrong.

Can someone review this considering the case where two process do an ls of
the same directory, that is a potential autofs4 mount (ie. an empty
directory not yet a mountpoint), at the same time.

--- linux-2.6.6-rc2-mm2/fs/autofs4/root.c.orig 2004-05-01 19:35:08.000000000 +0800
+++ linux-2.6.6-rc2-mm2/fs/autofs4/root.c 2004-05-01 19:38:31.000000000 +0800
@@ -93,6 +93,7 @@
{
struct dentry *top = dentry->d_sb->s_root;

+ spin_lock(&dcache_lock);
for(; dentry != top; dentry = dentry->d_parent) {
struct autofs_info *ino = autofs4_dentry_ino(dentry);

@@ -101,6 +102,7 @@
ino->last_used = jiffies;
}
}
+ spin_unlock(&dcache_lock);
}

/*