vfs: do_last(): use inode variable
Use helper variable instead of path->dentry->d_inode before complete_walk(). This will allow this code to be used in RCU mode. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -2358,15 +2358,17 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
|
|||||||
if (error)
|
if (error)
|
||||||
nd->flags |= LOOKUP_JUMPED;
|
nd->flags |= LOOKUP_JUMPED;
|
||||||
|
|
||||||
|
BUG_ON(nd->flags & LOOKUP_RCU);
|
||||||
|
inode = path->dentry->d_inode;
|
||||||
error = -ENOENT;
|
error = -ENOENT;
|
||||||
if (!path->dentry->d_inode)
|
if (!inode)
|
||||||
goto exit_dput;
|
goto exit_dput;
|
||||||
|
|
||||||
if (path->dentry->d_inode->i_op->follow_link)
|
if (inode->i_op->follow_link)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
path_to_nameidata(path, nd);
|
path_to_nameidata(path, nd);
|
||||||
nd->inode = path->dentry->d_inode;
|
nd->inode = inode;
|
||||||
/* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */
|
/* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */
|
||||||
error = complete_walk(nd);
|
error = complete_walk(nd);
|
||||||
if (error)
|
if (error)
|
||||||
|
Reference in New Issue
Block a user