Commit b7a437b0 authored by Linus Torvalds's avatar Linus Torvalds

Simplify exec_permission_lite() logic

Instead of returning EAGAIN and having the caller do something
special for that case,  just do the special case directly.
Reviewed-by: default avatarJames Morris <jmorris@namei.org>
Acked-by: default avatarSerge Hallyn <serue@us.ibm.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent e8e66ed2
...@@ -435,7 +435,7 @@ static int exec_permission_lite(struct inode *inode) ...@@ -435,7 +435,7 @@ static int exec_permission_lite(struct inode *inode)
umode_t mode = inode->i_mode; umode_t mode = inode->i_mode;
if (inode->i_op->permission) if (inode->i_op->permission)
return -EAGAIN; return inode_permission(inode, MAY_EXEC);
if (current_fsuid() == inode->i_uid) if (current_fsuid() == inode->i_uid)
mode >>= 6; mode >>= 6;
...@@ -853,9 +853,6 @@ static int __link_path_walk(const char *name, struct nameidata *nd) ...@@ -853,9 +853,6 @@ static int __link_path_walk(const char *name, struct nameidata *nd)
nd->flags |= LOOKUP_CONTINUE; nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode); err = exec_permission_lite(inode);
if (err == -EAGAIN)
err = inode_permission(nd->path.dentry->d_inode,
MAY_EXEC);
if (err) if (err)
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment