summaryrefslogtreecommitdiffstats
path: root/fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/namei.c')
-rw-r--r--fs/namei.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/namei.c b/fs/namei.c
index c5af0f37e67d..723a3fe4bc40 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -318,13 +318,16 @@ static inline int exec_permission(struct inode *inode, unsigned int flags)
{
int ret;
struct user_namespace *ns = inode_userns(inode);
+ int mask = MAY_EXEC;
+ if (flags & IPERM_FLAG_RCU)
+ mask |= MAY_NOT_BLOCK;
if (inode->i_op->permission) {
- ret = inode->i_op->permission(inode, MAY_EXEC, flags);
+ ret = inode->i_op->permission(inode, mask, flags);
if (likely(!ret))
goto ok;
} else {
- ret = acl_permission_check(inode, MAY_EXEC, flags);
+ ret = acl_permission_check(inode, mask, flags);
if (likely(!ret))
goto ok;
if (ret != -EACCES)