Hello Linus, could you please pull from git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs.git fsnotify_hsm_for_v6.14-rc1 to get support for fsnotify pre-content (or HSM) event. Let me quickly sum up what the feature is about: The patches introduce new fsnotify event (FS_PRE_ACCESS) that gets generated before a file contents is accessed. The event is synchronous so if there is listener for this event, the kernel waits for reply. On success the execution continues as usual, on failure we propagate the error to userspace. This allows userspace to fill in file content on demand from slow storage. The context in which the events are generated has been picked so that we don't hold any locks and thus there's no risk of a deadlock for the userspace handler. The new pre-content event is available only for users with global CAP_SYS_ADMIN capability (similarly to other parts of fanotify functionality) and it is an administrator responsibility to make sure the userspace event handler doesn't do stupid stuff that can DoS the system. Based on your feedback from the last submission, fsnotify code has been improved and now file->f_mode encodes whether pre-content event needs to be generated for the file so the fast path when nobody wants pre-content event for the file just grows the additional file->f_mode check. As a bonus this also removes the checks whether the old FS_ACCESS event needs to be generated from the fast path. Also the place where the event is generated during page fault has been moved so now filemap_fault() generates the event if and only if there is no uptodate folio in the page cache. Also we have dropped FS_PRE_MODIFY event as current real-world users of the pre-content functionality don't really use it so let's start with the minimal useful feature set. Top of the tree is 0c0214df28f0. The full shortlog is: Al Viro (1): fs: get rid of __FMODE_NONOTIFY kludge Amir Goldstein (11): fsnotify: opt-in for permission events at file open time fsnotify: check if file is actually being watched for pre-content events on open fanotify: rename a misnamed constant fanotify: reserve event bit of deprecated FAN_DIR_MODIFY fsnotify: introduce pre-content permission events fsnotify: pass optional file access range in pre-content event fsnotify: generate pre-content permission event on truncate fanotify: introduce FAN_PRE_ACCESS permission event fanotify: report file range info with pre-content events fanotify: allow to set errno in FAN_DENY permission response fs: don't block write during exec on pre-content watched files Jan Kara (2): ext4: add pre-content fsnotify hook for DAX faults fanotify: Fix crash in fanotify_init(2) Josef Bacik (7): fanotify: don't skip extra event info if no info_mode is set fanotify: disable readahead if we have pre-content watches mm: don't allow huge faults for files with pre content watches fsnotify: generate pre-content permission event on page fault xfs: add pre-content fsnotify hook for DAX faults btrfs: disable defrag on pre-content watched files fs: enable pre-content events on supported file systems The diffstat is fs/binfmt_elf.c | 4 +- fs/binfmt_elf_fdpic.c | 4 +- fs/btrfs/ioctl.c | 9 +++ fs/btrfs/super.c | 2 +- fs/exec.c | 8 +- fs/ext4/file.c | 3 + fs/ext4/super.c | 3 + fs/fcntl.c | 4 +- fs/notify/fanotify/fanotify.c | 31 ++++++-- fs/notify/fanotify/fanotify.h | 15 ++++ fs/notify/fanotify/fanotify_user.c | 150 +++++++++++++++++++++++++++++-------- fs/notify/fsnotify.c | 83 +++++++++++++++++++- fs/open.c | 62 +++++++++++---- fs/xfs/xfs_file.c | 13 ++++ fs/xfs/xfs_super.c | 2 +- include/linux/fanotify.h | 18 +++-- include/linux/fs.h | 72 ++++++++++++++++-- include/linux/fsnotify.h | 78 ++++++++++++++----- include/linux/fsnotify_backend.h | 53 ++++++++++++- include/linux/mm.h | 1 + include/uapi/asm-generic/fcntl.h | 1 - include/uapi/linux/fanotify.h | 18 +++++ kernel/fork.c | 12 +-- mm/filemap.c | 86 +++++++++++++++++++++ mm/memory.c | 19 +++++ mm/nommu.c | 7 ++ mm/readahead.c | 14 ++++ security/selinux/hooks.c | 3 +- 28 files changed, 669 insertions(+), 106 deletions(-) Thanks Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR