diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2012-05-21 11:30:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-01 12:11:58 -0400 |
commit | 54c33e7f95284539e52ec2d99dcdf6efd29b247f (patch) | |
tree | 777bbd294473b78538ba5ad3151c6e2596c94eee /fs | |
parent | d45ea86792db9679ed010b2c3df3db32b2ce5bde (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/namei.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c index c6b996817bb3..a7e994bb78c2 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2361,8 +2361,10 @@ static struct file *do_last(struct nameidata *nd, struct path *path, | |||
2361 | BUG_ON(nd->flags & LOOKUP_RCU); | 2361 | BUG_ON(nd->flags & LOOKUP_RCU); |
2362 | inode = path->dentry->d_inode; | 2362 | inode = path->dentry->d_inode; |
2363 | error = -ENOENT; | 2363 | error = -ENOENT; |
2364 | if (!inode) | 2364 | if (!inode) { |
2365 | goto exit_dput; | 2365 | path_to_nameidata(path, nd); |
2366 | goto exit; | ||
2367 | } | ||
2366 | 2368 | ||
2367 | if (should_follow_link(inode, !symlink_ok)) { | 2369 | if (should_follow_link(inode, !symlink_ok)) { |
2368 | if (nd->flags & LOOKUP_RCU) { | 2370 | if (nd->flags & LOOKUP_RCU) { |