Commit b21041d0 authored by Al Viro's avatar Al Viro

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: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent ce57dfc1
...@@ -768,7 +768,8 @@ __do_follow_link(const struct path *link, struct nameidata *nd, void **p) ...@@ -768,7 +768,8 @@ __do_follow_link(const struct path *link, struct nameidata *nd, void **p)
error = __vfs_follow_link(nd, s); error = __vfs_follow_link(nd, s);
else if (nd->last_type == LAST_BIND) { else if (nd->last_type == LAST_BIND) {
nd->flags |= LOOKUP_JUMPED; nd->flags |= LOOKUP_JUMPED;
if (nd->path.dentry->d_inode->i_op->follow_link) { nd->inode = nd->path.dentry->d_inode;
if (nd->inode->i_op->follow_link) {
/* stepped on a _really_ weird one */ /* stepped on a _really_ weird one */
path_put(&nd->path); path_put(&nd->path);
error = -ELOOP; error = -ELOOP;
...@@ -1449,7 +1450,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) ...@@ -1449,7 +1450,6 @@ static int link_path_walk(const char *name, struct nameidata *nd)
err = do_follow_link(&next, nd); err = do_follow_link(&next, nd);
if (err) if (err)
return err; return err;
nd->inode = nd->path.dentry->d_inode;
} }
err = -ENOTDIR; err = -ENOTDIR;
if (!nd->inode->i_op->lookup) if (!nd->inode->i_op->lookup)
...@@ -1475,7 +1475,6 @@ static int link_path_walk(const char *name, struct nameidata *nd) ...@@ -1475,7 +1475,6 @@ static int link_path_walk(const char *name, struct nameidata *nd)
err = do_follow_link(&next, nd); err = do_follow_link(&next, nd);
if (err) if (err)
return err; return err;
nd->inode = nd->path.dentry->d_inode;
} }
if (lookup_flags & LOOKUP_DIRECTORY) { if (lookup_flags & LOOKUP_DIRECTORY) {
err = -ENOTDIR; err = -ENOTDIR;
......
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