From: Mike Waychison <Michael.Waychison@Sun.COM>
- protect vfsmount->mnt_parent by taking vfsmount_lock in __d_path
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;