]> git.baikalelectronics.ru Git - kernel.git/commit
shmem: allow reporting fanotify events with file handles on tmpfs
authorAmir Goldstein <amir73il@gmail.com>
Mon, 22 Mar 2021 17:39:44 +0000 (19:39 +0200)
committerJan Kara <jack@suse.cz>
Mon, 19 Apr 2021 14:03:48 +0000 (16:03 +0200)
commitba8ff42cb30218ecf18c5a7789ce5a0aaea7e091
tree8a24983b9d5074a44a9ae419904de8b3dbb4f27e
parenta8abf73538a097c6950184303eca214ebb02f86a
shmem: allow reporting fanotify events with file handles on tmpfs

Since kernel v5.1, fanotify_init(2) supports the flag FAN_REPORT_FID
for identifying objects using file handle and fsid in events.

fanotify_mark(2) fails with -ENODEV when trying to set a mark on
filesystems that report null f_fsid in stasfs(2).

Use the digest of uuid as f_fsid for tmpfs to uniquely identify tmpfs
objects as best as possible and allow setting an fanotify mark that
reports events with file handles on tmpfs.

Link: https://lore.kernel.org/r/20210322173944.449469-3-amir73il@gmail.com
Acked-by: Hugh Dickins <hughd@google.com>
Reviewed-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
mm/shmem.c