aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
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)