Skip to content

Fix for potential deadlock in pre-content event

Amir Goldstein linux-fsdevel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest6 patches 1 replyIn review
  2. v12 patches 4 repliesSuperseded

Changes in v3 from the cover letter

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6fsnotify: add pre-content hooks on mmap()include/linux/fsnotify.h mm/util.c+24 -00 replies
2/6Revert "ext4: add pre-content fsnotify hook for DAX faults"fs/ext4/file.c+0 -30 replies
3/6Revert "xfs: add pre-content fsnotify hook for DAX faults"fs/xfs/xfs_file.c+0 -130 replies
4/6Revert "fsnotify: generate pre-content permission event on page fault"include/linux/mm.h mm/filemap.c mm/nommu.c+0 -820 replies
5/6Revert "mm: don't allow huge faults for files with pre content watches"mm/memory.c+0 -190 replies
6/6Revert "fanotify: disable readahead if we have pre-content watches"mm/filemap.c mm/readahead.c+0 -260 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/6] Fix for potential deadlock in pre-content event

Jan,

This is the mmap solution proposed by Josef to solve the potential deadlock with faulting in user pages [1].

I've added test coverage to mmap() pre-content events and verified no pre-content events on page fault [2].

After some push back on [v2] for disabling page fault pre-content hooks while leaving their code in the kernel, this series revert the page fault pre-content hooks.

This leaves DAX files access without pre-content hooks, but that was never a goal for this feature, so I think that is fine.

Thanks,
Amir.

Changes since v2:
- Revert page fault pre-content hooks
- Remove mmap hook from remap_file_pages() (Lorenzo)
- Create fsnotify_mmap_perm() wrapper (Lorenzo)

[1] https://lore.kernel.org/linux-fsdevel/20250307154614.GA59451@perftesting/
[2] https://github.com/amir73il/ltp/commits/fan_hsm/
[v2] https://lore.kernel.org/linux-fsdevel/[email protected]/
[v1] https://lore.kernel.org/linux-fsdevel/[email protected]/

Amir Goldstein (6):
fsnotify: add pre-content hooks on mmap()
Revert "ext4: add pre-content fsnotify hook for DAX faults" Revert "xfs: add pre-content fsnotify hook for DAX faults" Revert "fsnotify: generate pre-content permission event on page fault" Revert "mm: don't allow huge faults for files with pre content
watches"
Revert "fanotify: disable readahead if we have pre-content watches"

 fs/ext4/file.c           |  3 --
 fs/xfs/xfs_file.c        | 13 ------
 include/linux/fsnotify.h | 21 ++++++++++
 include/linux/mm.h       |  1 -
 mm/filemap.c             | 86 ----------------------------------------
 mm/memory.c              | 19 ---------
 mm/nommu.c               |  7 ----
 mm/readahead.c           | 14 -------
 mm/util.c                |  3 ++
 9 files changed, 24 insertions(+), 143 deletions(-)
Signature · 1 line
2.34.1