Skip to content

cheaper MAY_EXEC handling for path lookup

Mateusz Guzik linux-btrfs linux-ext4 linux-fsdevel lkml 3 versions – Applied

Status from this message: Applied to the vfs-6.19.misc branch of the vfs/vfs.git tree.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 10 repliesApplied
  2. v24 patches 2 repliesSuperseded
  3. v11 patch 0 repliesSuperseded

Changes in v3 from the cover letter

- drop the pre-computation idea and inline the perm check
- add IOP_FASTPERM_MAY_EXEC for filesystems with ->permission hooks so that they can also take advantage of it

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/3fs: speed up path lookup with cheaper handling of MAY_EXECfs/namei.c include/linux/fs.h+48 -87 replies
2/3btrfs: utilize IOP_FASTPERM_MAY_EXECfs/btrfs/inode.c+11 -11 reply
3/3fs: retire now stale MAY_WRITE predicts in inode_permission()fs/namei.c+2 -21 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchJan KaraDavid Sterba
1/3R-b
2/3A-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/3] cheaper MAY_EXEC handling for path lookup

Commit message in patch 1 says it all.

In short, MAY_WRITE checks are elided.

This obsoletes the idea of pre-computing if perm checks are necessary as that turned out to be too hairy. The new code has 2 more branches per path component compared to that idea, but the perf difference for typical paths (< 6 components) was basically within noise. To be revisited if someone(tm) removes other slowdowns.

Instead of the pre-computing thing I added IOP_FASTPERM_MAY_EXEC so that filesystems like btrfs can still avoid the hard work.

v3:
- drop the pre-computation idea and inline the perm check
- add IOP_FASTPERM_MAY_EXEC for filesystems with ->permission hooks so that they can also take advantage of it

Mateusz Guzik (3):
fs: speed up path lookup with cheaper handling of MAY_EXEC
btrfs: utilize IOP_FASTPERM_MAY_EXEC
fs: retire now stale MAY_WRITE predicts in inode_permission()

 fs/btrfs/inode.c   | 12 +++++++++++-
 fs/namei.c         | 47 ++++++++++++++++++++++++++++++++++++++++++----
 include/linux/fs.h | 13 +++++++------
 3 files changed, 61 insertions(+), 11 deletions(-)
Signature · 1 line
2.48.1