summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2017-04-15 23:29:14 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-21 20:05:35 +0200
commit93893862fb7ba704ec5a6872a294c9cc2b0d4ca3 (patch)
tree0281c6a58d798efa4436ad0d2ad54c02d8e6a0fb /fs/namei.c
parentmake sure that fchdir() won't accept referral points, etc. (diff)
downloadlinux-93893862fb7ba704ec5a6872a294c9cc2b0d4ca3.tar.xz
linux-93893862fb7ba704ec5a6872a294c9cc2b0d4ca3.zip
path_init(): don't bother with checking MAY_EXEC for LOOKUP_ROOT
we'll hit that check in link_path_walk() anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/fs/namei.c b/fs/namei.c
index 19dcf62133cc..60c0a78ebca7 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2142,7 +2142,6 @@ OK:
static const char *path_init(struct nameidata *nd, unsigned flags)
{
- int retval = 0;
const char *s = nd->name->name;
if (!*s)
@@ -2154,13 +2153,8 @@ static const char *path_init(struct nameidata *nd, unsigned flags)
if (flags & LOOKUP_ROOT) {
struct dentry *root = nd->root.dentry;
struct inode *inode = root->d_inode;
- if (*s) {
- if (!d_can_lookup(root))
- return ERR_PTR(-ENOTDIR);
- retval = inode_permission(inode, MAY_EXEC);
- if (retval)
- return ERR_PTR(retval);
- }
+ if (*s && unlikely(!d_can_lookup(root)))
+ return ERR_PTR(-ENOTDIR);
nd->path = nd->root;
nd->inode = inode;
if (flags & LOOKUP_RCU) {