linux-stable/fs/overlayfs
Amir Goldstein bc2473c90f
ovl: enable fsnotify events on underlying real files
Overlayfs creates the real underlying files with fake f_path, whose
f_inode is on the underlying fs and f_path on overlayfs.

Those real files were open with FMODE_NONOTIFY, because fsnotify code was
not prapared to handle fsnotify hooks on files with fake path correctly
and fanotify would report unexpected event->fd with fake overlayfs path,
when the underlying fs was being watched.

Teach fsnotify to handle events on the real files, and do not set real
files to FMODE_NONOTIFY to allow operations on real file (e.g. open,
access, modify, close) to generate async and permission events.

Because fsnotify does not have notifications on address space
operations, we do not need to worry about ->vm_file not reporting
events to a watched overlayfs when users are accessing a mapped
overlayfs file.

Acked-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Message-Id: <20230615112229.2143178-6-amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2023-06-19 18:18:04 +02:00
..
copy_up.c ovl: check for ->listxattr() support 2023-03-06 09:57:13 +01:00
dir.c fs: port inode_init_owner() to mnt_idmap 2023-01-19 09:24:28 +01:00
export.c fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
file.c ovl: enable fsnotify events on underlying real files 2023-06-19 18:18:04 +02:00
inode.c fs: port vfs{g,u}id helpers to mnt_idmap 2023-01-19 09:24:30 +01:00
Kconfig ovl: Kconfig: Fix spelling mistake "undelying" -> "underlying" 2022-12-08 10:49:46 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
namei.c fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
overlayfs.h fs: rename {vfs,kernel}_tmpfile_open() 2023-06-19 18:09:09 +02:00
ovl_entry.h fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
readdir.c fs: port ->permission() to pass mnt_idmap 2023-01-19 09:24:28 +01:00
super.c fs: drop unused posix acl handlers 2023-03-06 09:57:12 +01:00
util.c fs: port i_{g,u}id_into_vfs{g,u}id() to mnt_idmap 2023-01-19 09:24:29 +01:00