diff options
author | Andrew <[email protected]> | 2022-04-01 11:53:54 -0500 |
---|---|---|
committer | GitHub <[email protected]> | 2022-04-01 09:53:54 -0700 |
commit | eebfd28e9d712bcfb5a6d20d59be208645474066 (patch) | |
tree | 3c25160698536f5fcfbbe31fc71ba92d7b871ca9 /module/os/linux/zfs/zfs_vnops_os.c | |
parent | 6a2dda8f05d9fb3c5b7d81c8c6762cd43be07dd7 (diff) |
Linux optimize access checks when ACL is trivial
Bypass check of ZFS aces if the ACL is trivial. When an ACL is
trivial its permissions are represented by the mode without any
loss of information. In this case, it is safe to convert the
access request into equivalent mode and then pass desired mask
and inode to generic_permission(). This has the added benefit
of also checking whether entries in a POSIX ACL on the file grant
the desired access.
This commit also skips the ACL check on looking up the xattr dir
since such restrictions don't exist in Linux kernel and it makes
xattr lookup behavior inconsistent between SA and file-based
xattrs. We also don't want to perform a POSIX ACL check while
looking up the POSIX ACL if for some reason it is located in
the xattr dir rather than an SA.
Reviewed-by: Brian Behlendorf <[email protected]>
Co-authored-by: Ryan Moeller <[email protected]>
Signed-off-by: Andrew Walker <[email protected]>
Closes #13237
Diffstat (limited to 'module/os/linux/zfs/zfs_vnops_os.c')
-rw-r--r-- | module/os/linux/zfs/zfs_vnops_os.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/module/os/linux/zfs/zfs_vnops_os.c b/module/os/linux/zfs/zfs_vnops_os.c index ece7c373e..b65728f0d 100644 --- a/module/os/linux/zfs/zfs_vnops_os.c +++ b/module/os/linux/zfs/zfs_vnops_os.c @@ -474,7 +474,7 @@ zfs_lookup(znode_t *zdp, char *nm, znode_t **zpp, int flags, cred_t *cr, */ if ((error = zfs_zaccess(*zpp, ACE_EXECUTE, 0, - B_FALSE, cr))) { + B_TRUE, cr))) { zrele(*zpp); *zpp = NULL; } |