Skip to content

Commit

Permalink
Simplify exec_permission_lite() logic
Browse files Browse the repository at this point in the history
Instead of returning EAGAIN and having the caller do something
special for that case,  just do the special case directly.

Reviewed-by: James Morris <jmorris@namei.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Linus Torvalds committed Sep 8, 2009
1 parent e8e66ed commit b7a437b
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ static int exec_permission_lite(struct inode *inode)
umode_t mode = inode->i_mode;

if (inode->i_op->permission)
return -EAGAIN;
return inode_permission(inode, MAY_EXEC);

if (current_fsuid() == inode->i_uid)
mode >>= 6;
Expand Down Expand Up @@ -853,9 +853,6 @@ static int __link_path_walk(const char *name, struct nameidata *nd)

nd->flags |= LOOKUP_CONTINUE;
err = exec_permission_lite(inode);
if (err == -EAGAIN)
err = inode_permission(nd->path.dentry->d_inode,
MAY_EXEC);
if (err)
break;

Expand Down

0 comments on commit b7a437b

Please sign in to comment.