Commit 122eace8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] __d_path needs vfsmount_lock

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

- protect vfsmount->mnt_parent by taking vfsmount_lock in __d_path
parent 702e97e7
...@@ -1296,10 +1296,14 @@ static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt, ...@@ -1296,10 +1296,14 @@ static char * __d_path( struct dentry *dentry, struct vfsmount *vfsmnt,
break; break;
if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) { if (dentry == vfsmnt->mnt_root || IS_ROOT(dentry)) {
/* Global root? */ /* Global root? */
if (vfsmnt->mnt_parent == vfsmnt) spin_lock(&vfsmount_lock);
if (vfsmnt->mnt_parent == vfsmnt) {
spin_unlock(&vfsmount_lock);
goto global_root; goto global_root;
}
dentry = vfsmnt->mnt_mountpoint; dentry = vfsmnt->mnt_mountpoint;
vfsmnt = vfsmnt->mnt_parent; vfsmnt = vfsmnt->mnt_parent;
spin_unlock(&vfsmount_lock);
continue; continue;
} }
parent = dentry->d_parent; parent = dentry->d_parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment