vfs: do_last(): make ENOENT exit RCU safe
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:
parent
d45ea86792
commit
54c33e7f95
1 changed files with 4 additions and 2 deletions
|
@ -2361,8 +2361,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
|
|||
BUG_ON(nd->flags & LOOKUP_RCU);
|
||||
inode = path->dentry->d_inode;
|
||||
error = -ENOENT;
|
||||
if (!inode)
|
||||
goto exit_dput;
|
||||
if (!inode) {
|
||||
path_to_nameidata(path, nd);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (should_follow_link(inode, !symlink_ok)) {
|
||||
if (nd->flags & LOOKUP_RCU) {
|
||||
|
|
Loading…
Reference in a new issue