Commit 54c33e7f authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Al Viro

vfs: do_last(): make ENOENT exit RCU safe

This will allow this code to be used in RCU mode.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent d45ea867
...@@ -2361,8 +2361,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path, ...@@ -2361,8 +2361,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
BUG_ON(nd->flags & LOOKUP_RCU); BUG_ON(nd->flags & LOOKUP_RCU);
inode = path->dentry->d_inode; inode = path->dentry->d_inode;
error = -ENOENT; error = -ENOENT;
if (!inode) if (!inode) {
goto exit_dput; path_to_nameidata(path, nd);
goto exit;
}
if (should_follow_link(inode, !symlink_ok)) { if (should_follow_link(inode, !symlink_ok)) {
if (nd->flags & LOOKUP_RCU) { if (nd->flags & LOOKUP_RCU) {
......
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