diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-11-01 13:52:25 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-11-01 14:12:34 +0100 |
commit | cb80d9074f2a56c8226657b01f19656584fc3ab5 (patch) | |
tree | 5ca2aa0a02efcfb9e426ef1bd02eddcdcca527ce /tools/perf/scripts/python/stackcollapse.py | |
parent | e017671f534dd3f568db9e47b0583e853d2da9b5 (diff) |
fs: optimize acl_permission_check()
generic_permission() turned out to be costlier than expected. The reason
is that acl_permission_check() performs owner checks that involve costly
pointer dereferences.
There's already code that skips expensive group checks if the group and
other permission bits are the same wrt to the mask that is checked. This
logic can be extended to also shortcut permission checking in
acl_permission_check().
If the inode doesn't have POSIX ACLs than ownership doesn't matter. If
there are no missing UGO permissions the permission check can be
shortcut.
Acked-by: Al Viro <viro@zeniv.linux.org.uk>
Link: https://lore.kernel.org/all/CAHk-=wgXEoAOFRkDg+grxs+p1U+QjWXLixRGmYEfd=vG+OBuFw@mail.gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions