diff options
Diffstat (limited to 'fs/aufs/i_op.c')
-rw-r--r-- | fs/aufs/i_op.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/aufs/i_op.c b/fs/aufs/i_op.c index 7b515db87..c730ec71f 100644 --- a/fs/aufs/i_op.c +++ b/fs/aufs/i_op.c @@ -18,12 +18,15 @@ static int h_permission(struct inode *h_inode, int mask, int err; const unsigned char write_mask = !!(mask & (MAY_WRITE | MAY_APPEND)); + err = -EPERM; + if (write_mask && IS_IMMUTABLE(h_inode)) + goto out; + err = -EACCES; - if ((write_mask && IS_IMMUTABLE(h_inode)) - || ((mask & MAY_EXEC) - && S_ISREG(h_inode->i_mode) - && (path_noexec(h_path) - || !(h_inode->i_mode & S_IXUGO)))) + if (((mask & MAY_EXEC) + && S_ISREG(h_inode->i_mode) + && (path_noexec(h_path) + || !(h_inode->i_mode & S_IXUGO)))) goto out; /* |