]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fsnotify: add pre-content hooks on mmap()
authorAmir Goldstein <amir73il@gmail.com>
Wed, 12 Mar 2025 07:38:47 +0000 (08:38 +0100)
committerJan Kara <jack@suse.cz>
Wed, 12 Mar 2025 16:57:32 +0000 (17:57 +0100)
commit066e053fe208a3b83ee89dc5a192146add688861
treeb57b33883a8d12e6fd522e3d50ba1a6a082fdf17
parent0fed89a961ea851945d23cc35beb59d6e56c0964
fsnotify: add pre-content hooks on mmap()

Pre-content hooks in page faults introduces potential deadlock of HSM
handler in userspace with filesystem freezing.

The requirement with pre-content event is that for every accessed file
range an event covering at least this range will be generated at least
once before the file data is accesses.

In preparation to disabling pre-content event hooks on page faults,
add pre-content hooks at mmap() variants for the entire mmaped range,
so HSM can fill content when user requests to map a portion of the file.

Note that exec() variant also calls vm_mmap_pgoff() internally to map
code sections, so pre-content hooks are also generated in this case.

Link: https://lore.kernel.org/linux-fsdevel/7ehxrhbvehlrjwvrduoxsao5k3x4aw275patsb3krkwuq573yv@o2hskrfawbnc/
Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250312073852.2123409-2-amir73il@gmail.com
include/linux/fsnotify.h
mm/util.c