aboutsummaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2011-03-14 20:01:51 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2011-03-15 17:16:25 -0400
commitb21041d0f72899ed815bd2cbf7275339c74737b6 (patch)
treee9dddabedc599175926ea29603ca366cdc50dbaa /fs/namei.c
parentce57dfc1791221ef58b6d6b8f5437fccefc4e187 (diff)
update nd->inode in __do_follow_link() instead of after do_follow_link()
... and note that we only need to do it for LAST_BIND symlinks Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 549bbe2f25c6..9e7b18a8be66 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -768,7 +768,8 @@ __do_follow_link(const struct path *link, struct nameidata *nd, void **p)
768 error = __vfs_follow_link(nd, s); 768 error = __vfs_follow_link(nd, s);
769 else if (nd->last_type == LAST_BIND) { 769 else if (nd->last_type == LAST_BIND) {
770 nd->flags |= LOOKUP_JUMPED; 770 nd->flags |= LOOKUP_JUMPED;
771 if (nd->path.dentry->d_inode->i_op->follow_link) { 771 nd->inode = nd->path.dentry->d_inode;
772 if (nd->inode->i_op->follow_link) {
772 /* stepped on a _really_ weird one */ 773 /* stepped on a _really_ weird one */
773 path_put(&nd->path); 774 path_put(&nd->path);
774 error = -ELOOP; 775 error = -ELOOP;
@@ -1449,7 +1450,6 @@ static int link_path_walk(const char *name, struct nameidata *nd)
1449 err = do_follow_link(&next, nd); 1450 err = do_follow_link(&next, nd);
1450 if (err) 1451 if (err)
1451 return err; 1452 return err;
1452 nd->inode = nd->path.dentry->d_inode;
1453 } 1453 }
1454 err = -ENOTDIR; 1454 err = -ENOTDIR;
1455 if (!nd->inode->i_op->lookup) 1455 if (!nd->inode->i_op->lookup)
@@ -1475,7 +1475,6 @@ last_component:
1475 err = do_follow_link(&next, nd); 1475 err = do_follow_link(&next, nd);
1476 if (err) 1476 if (err)
1477 return err; 1477 return err;
1478 nd->inode = nd->path.dentry->d_inode;
1479 } 1478 }
1480 if (lookup_flags & LOOKUP_DIRECTORY) { 1479 if (lookup_flags & LOOKUP_DIRECTORY) {
1481 err = -ENOTDIR; 1480 err = -ENOTDIR;