summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@www.linux.org.uk>2005-06-06 22:36:01 +0200
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-06 23:42:24 +0200
commitd73ffe16b8baafae6e9249acee6b50c24099c6de (patch)
tree321319974be9fcc50f4ec36ccad26b84d4b66b66 /fs
parent[PATCH] namei fixes (3/19) (diff)
downloadlinux-d73ffe16b8baafae6e9249acee6b50c24099c6de.tar.xz
linux-d73ffe16b8baafae6e9249acee6b50c24099c6de.zip
[PATCH] namei fixes (4/19)
path.mnt in open_namei() set to mirror nd->mnt. nd->mnt is set in 3 places in that function - path_lookup() in the beginning, __follow_down() loop after do_last: and __do_follow_link() call after do_link:. We set path.mnt to nd->mnt after path_lookup() and __do_follow_link(). In __follow_down() loop we use &path.mnt instead of &nd->mnt and set nd->mnt to path.mnt immediately after that loop. Obviously equivalent transformation. Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/namei.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 167f19b5e51a..e42f7c35545a 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -1442,6 +1442,7 @@ int open_namei(const char * pathname, int flag, int mode, struct nameidata *nd)
nd->flags &= ~LOOKUP_PARENT;
down(&dir->d_inode->i_sem);
path.dentry = __lookup_hash(&nd->last, nd->dentry, nd);
+ path.mnt = nd->mnt;
do_last:
error = PTR_ERR(path.dentry);
@@ -1479,7 +1480,8 @@ do_last:
error = -ELOOP;
if (flag & O_NOFOLLOW)
goto exit_dput;
- while (__follow_down(&nd->mnt,&path.dentry) && d_mountpoint(path.dentry));
+ while (__follow_down(&path.mnt,&path.dentry) && d_mountpoint(path.dentry));
+ nd->mnt = path.mnt;
}
error = -ENOENT;
if (!path.dentry->d_inode)
@@ -1524,6 +1526,7 @@ do_link:
goto exit_dput;
error = __do_follow_link(path.dentry, nd);
dput(path.dentry);
+ path.mnt = nd->mnt;
if (error)
return error;
nd->flags &= ~LOOKUP_PARENT;