Skip to content

Commit

Permalink
vfs: do_last(): make ENOENT exit RCU safe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miklos Szeredi authored and Al Viro committed Jun 1, 2012
1 parent d45ea86 commit 54c33e7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 54c33e7

Please sign in to comment.