From: <raven@themaw.net>

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.


---

 25-akpm/fs/autofs4/root.c |    2 ++
 1 files changed, 2 insertions(+)

diff -puN fs/autofs4/root.c~autofs-locking-fix fs/autofs4/root.c
--- 25/fs/autofs4/root.c~autofs-locking-fix	Mon May  3 13:34:26 2004
+++ 25-akpm/fs/autofs4/root.c	Mon May  3 13:34:26 2004
@@ -93,6 +93,7 @@ static void autofs4_update_usage(struct 
 {
 	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 @@ static void autofs4_update_usage(struct 
 			ino->last_used = jiffies;
 		}
 	}
+	spin_unlock(&dcache_lock);
 }
 
 /*

_