public inbox for linux-fsdevel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 00/10] fanotify namespace monitoring
@ 2026-04-24 17:04 Amir Goldstein
  2026-04-24 17:04 ` [PATCH v2 01/10] fsnotify: rename fsnotify group flag macros Amir Goldstein
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Amir Goldstein @ 2026-04-24 17:04 UTC (permalink / raw)
  To: Jan Kara; +Cc: Christian Brauner, linux-fsdevel

Jan,

Following your feedback from v1 [1] review, I've made the changes
to clear the way for reusing the fs watcher event bits for ns watcher
event bits.

The terminology of "ns watcher" vs. "ns events" is a little confusing:
- "ns watcher" group can place mark on ns objects with
  mntns/userns marks
- The events that can be requested by ns watcher are
  mount (tree monitoring) and ns (tree monitoring) events
- We could imagine requesting all mount events of all mntns owned
  by a specific userns, but this was not implemented
- "fs watcher" group can place mark on fs objects with
  inode/mnt/sb marks
- The events that can be requested by fs watcher are
  fs (monitoring, permission and pre-content) events

To simplify the implementation, the event flags (ON_CHILD, ISDIR)
live in a shared space that cannot be overloaded by neither group types.
This is not because ISDIR makes sense for ns watcher, just to reduce the
number of gates in common code. ON_CHILD flag might be usable for ns
watchers, not sure.

Thanks,
Amir.

Changes since v1:
- Introduce group type and gates
- FAN_NS_CREATE/FAN_NS_DELETE overload FAN_CREATE/FAN_DELETE in uapi
  instead of using high 32bit

[1] https://lore.kernel.org/linux-fsdevel/20260307110550.373762-1-amir73il@gmail.com/

Amir Goldstein (10):
  fsnotify: rename fsnotify group flag macros
  fsnotify: introduce fsnotify group types
  fsnotify: separate the events bitmask macros by group type
  fanotify: test event->type instead of event mask when possible
  fsnotify: do not report mount events with fsnotify()
  fanotify: gate fs event classification by group type
  fanotify: gate fs events checks in fanotify_mark() by group type
  fanotify: add support for watching the namespaces tree
  selftests/filesystems: create fanotify test dir
  selftests/filesystems: add fanotify namespace notifications test

 fs/notify/fanotify/fanotify.c                 | 141 ++++++--
 fs/notify/fanotify/fanotify.h                 |  62 +++-
 fs/notify/fanotify/fanotify_user.c            | 218 +++++++++---
 fs/notify/fdinfo.c                            |   9 +-
 fs/notify/fsnotify.c                          | 123 +++++--
 fs/notify/fsnotify.h                          |  12 +
 fs/notify/group.c                             |  14 +-
 fs/notify/inotify/inotify_user.c              |   2 +-
 fs/notify/mark.c                              |   9 +-
 fs/nsfs.c                                     |  21 ++
 include/linux/fanotify.h                      |  40 ++-
 include/linux/fsnotify.h                      |   5 +
 include/linux/fsnotify_backend.h              | 108 ++++--
 include/linux/proc_fs.h                       |   2 +
 include/linux/user_namespace.h                |   6 +
 include/uapi/linux/fanotify.h                 |  37 +-
 kernel/audit_fsnotify.c                       |   2 +-
 kernel/nscommon.c                             |  47 +++
 kernel/user_namespace.c                       |   2 +
 tools/include/uapi/linux/fanotify.h           |  37 +-
 tools/testing/selftests/Makefile              |   2 +-
 .../{mount-notify => fanotify}/.gitignore     |   0
 .../{mount-notify => fanotify}/Makefile       |   3 +-
 .../mount-notify_test.c                       |   0
 .../mount-notify_test_ns.c                    |   0
 .../filesystems/fanotify/ns-notify_test.c     | 330 ++++++++++++++++++
 26 files changed, 1045 insertions(+), 187 deletions(-)
 rename tools/testing/selftests/filesystems/{mount-notify => fanotify}/.gitignore (100%)
 rename tools/testing/selftests/filesystems/{mount-notify => fanotify}/Makefile (67%)
 rename tools/testing/selftests/filesystems/{mount-notify => fanotify}/mount-notify_test.c (100%)
 rename tools/testing/selftests/filesystems/{mount-notify => fanotify}/mount-notify_test_ns.c (100%)
 create mode 100644 tools/testing/selftests/filesystems/fanotify/ns-notify_test.c

-- 
2.54.0


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-04-24 17:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-24 17:04 [PATCH v2 00/10] fanotify namespace monitoring Amir Goldstein
2026-04-24 17:04 ` [PATCH v2 01/10] fsnotify: rename fsnotify group flag macros Amir Goldstein
2026-04-24 17:04 ` [PATCH v2 02/10] fsnotify: introduce fsnotify group types Amir Goldstein
2026-04-24 17:04 ` [PATCH v2 03/10] fsnotify: separate the events bitmask macros by group type Amir Goldstein
2026-04-24 17:04 ` [PATCH v2 04/10] fanotify: test event->type instead of event mask when possible Amir Goldstein
2026-04-24 17:04 ` [PATCH v2 05/10] fsnotify: do not report mount events with fsnotify() Amir Goldstein
2026-04-24 17:04 ` [PATCH v2 06/10] fanotify: gate fs event classification by group type Amir Goldstein
2026-04-24 17:05 ` [PATCH v2 07/10] fanotify: gate fs events checks in fanotify_mark() " Amir Goldstein
2026-04-24 17:05 ` [PATCH v2 08/10] fanotify: add support for watching the namespaces tree Amir Goldstein
2026-04-24 17:05 ` [PATCH v2 09/10] selftests/filesystems: create fanotify test dir Amir Goldstein
2026-04-24 17:05 ` [PATCH v2 10/10] selftests/filesystems: add fanotify namespace notifications test Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox