From: Mike Waychison <Michael.Waychison@Sun.COM>

- protect vfsmount->mnt_parent by taking vfsmount_lock in __d_path



---

 25-akpm/fs/dcache.c |    6 +++++-
 mm/filemap.c        |    0 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff -puN fs/dcache.c~d_path-needs-vfsmount_lock fs/dcache.c
--- 25/fs/dcache.c~d_path-needs-vfsmount_lock	Mon Jan 26 15:56:29 2004
+++ 25-akpm/fs/dcache.c	Mon Jan 26 15:56:29 2004
@@ -1297,10 +1297,14 @@ static char * __d_path( struct dentry *d
 			break;
 		if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
 			/* Global root? */
-			if (vfsmnt->mnt_parent == vfsmnt)
+			spin_lock(&vfsmount_lock);
+			if (vfsmnt->mnt_parent == vfsmnt) {
+				spin_unlock(&vfsmount_lock);
 				goto global_root;
+			}
 			dentry = vfsmnt->mnt_mountpoint;
 			vfsmnt = vfsmnt->mnt_parent;
+			spin_unlock(&vfsmount_lock);
 			continue;
 		}
 		parent = dentry->d_parent;
diff -puN mm/filemap.c~d_path-needs-vfsmount_lock mm/filemap.c

_