aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-05-21 11:30:08 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-06-01 12:11:57 -0400
commitdecf3400879d02d0eafedea52c7f208587be062a (patch)
tree988c4006b9689c50cb43a379069dc5ea019567d8 /fs
parenta1eb33153090549e622ab42cb375af06614dd7a8 (diff)
vfs: do_last(): use inode variable
Use helper variable instead of path->dentry->d_inode before complete_walk(). 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.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/namei.c b/fs/namei.c
index f6b31c94c110..41445e7fd339 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2358,15 +2358,17 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
2358 if (error) 2358 if (error)
2359 nd->flags |= LOOKUP_JUMPED; 2359 nd->flags |= LOOKUP_JUMPED;
2360 2360
2361 BUG_ON(nd->flags & LOOKUP_RCU);
2362 inode = path->dentry->d_inode;
2361 error = -ENOENT; 2363 error = -ENOENT;
2362 if (!path->dentry->d_inode) 2364 if (!inode)
2363 goto exit_dput; 2365 goto exit_dput;
2364 2366
2365 if (path->dentry->d_inode->i_op->follow_link) 2367 if (inode->i_op->follow_link)
2366 return NULL; 2368 return NULL;
2367 2369
2368 path_to_nameidata(path, nd); 2370 path_to_nameidata(path, nd);
2369 nd->inode = path->dentry->d_inode; 2371 nd->inode = inode;
2370 /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ 2372 /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */
2371 error = complete_walk(nd); 2373 error = complete_walk(nd);
2372 if (error) 2374 if (error)