Commit 54c33e7f95284539e52ec2d99dcdf6efd29b247f
Committed by
Al Viro
1 parent
d45ea86792
Exists in
master
and in
20 other branches
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>
Showing 1 changed file with 4 additions and 2 deletions Side-by-side Diff
fs/namei.c
... | ... | @@ -2361,8 +2361,10 @@ |
2361 | 2361 | BUG_ON(nd->flags & LOOKUP_RCU); |
2362 | 2362 | inode = path->dentry->d_inode; |
2363 | 2363 | error = -ENOENT; |
2364 | - if (!inode) | |
2365 | - goto exit_dput; | |
2364 | + if (!inode) { | |
2365 | + path_to_nameidata(path, nd); | |
2366 | + goto exit; | |
2367 | + } | |
2366 | 2368 | |
2367 | 2369 | if (should_follow_link(inode, !symlink_ok)) { |
2368 | 2370 | if (nd->flags & LOOKUP_RCU) { |