Skip to content

Commit 54c33e7

Browse files
Miklos SzerediAl Viro
authored andcommitted
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>
1 parent d45ea86 commit 54c33e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/namei.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2361,8 +2361,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
23612361
BUG_ON(nd->flags & LOOKUP_RCU);
23622362
inode = path->dentry->d_inode;
23632363
error = -ENOENT;
2364-
if (!inode)
2365-
goto exit_dput;
2364+
if (!inode) {
2365+
path_to_nameidata(path, nd);
2366+
goto exit;
2367+
}
23662368

23672369
if (should_follow_link(inode, !symlink_ok)) {
23682370
if (nd->flags & LOOKUP_RCU) {

0 commit comments

Comments
 (0)