Skip to content

fanotify: add support for more event types

Amir Goldstein linux-arch linux-fsdevel linux-mips 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest17 patches 13 repliesIn review
  2. v415 patches 38 repliesSuperseded
  3. v313 patches 28 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v29 patches2 repliesSuperseded

Changes in v5 from the cover letter

- Rebase on v5.0-rc1
- Address style review comments on v4
- info_len includes padding to info_hdr alignment
- handle caching of fsid correctly when inotify marks on object exist
- Report dirent events on subdirs only with FAN_ONDIR
- Report XXX_SELF events on directories only with FAN_ONDIR
- Do not merge dirent events on subdirs with dirent events on non subdirs

[1] https://github.com/amir73il/linux/commits/fanotify_dirent-v5
[2] https://github.com/amir73il/ltp/commits/fanotify_fid
[3] https://github.com/amir73il/ltp/commits/fanotify_dirent
[4] https://github.com/amir73il/inotify-tools/commits/fanotify_dirent

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/17fsnotify: annotate directory entry modification eventsinclude/linux/fsnotify.h+59 -91 reply
2/17fsnotify: remove dirent events from FS_EVENTS_POSS_ON_CHILD maskinclude/linux/fsnotify_backend.h+21 -150 replies
3/17fsnotify: send all event types to super block marksfs/notify/fsnotify.c+7 -80 replies
4/17fsnotify: move mask out of struct fsnotify_eventfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c +5 more+29 -400 replies
5/17fanotify: rename struct fanotify_{,perm_}event_infofs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c+26 -260 replies
6/17fanotify: open code fill_event_metadata()fs/notify/fanotify/fanotify_user.c+26 -430 replies
7/17fanotify: encode file identifier for FAN_REPORT_FIDfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c +1 more+153 -132 replies
8/17fanotify: copy event fid info to userfs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c include/uapi/linux/fanotify.h+102 -51 reply
9/17fanotify: enable FAN_REPORT_FID init flagfs/notify/fanotify/fanotify_user.c include/linux/fanotify.h+61 -20 replies
10/17fanotify: cache fsid in fsnotify_mark_connectorfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c +2 more+135 -545 replies
11/17vfs: add vfs_get_fsid() helperfs/statfs.c include/linux/statfs.h+17 -00 replies
12/17fanotify: use vfs_get_fsid() helper instead of vfs_statfs()fs/notify/fanotify/fanotify_user.c+10 -150 replies
13/17fsnotify: report FS_ISDIR flag with MOVE_SELF and DELETE_SELF eventsfs/notify/inotify/inotify_fsnotify.c include/linux/fsnotify.h+28 -41 reply
14/17fanotify: check FS_ISDIR flag instead of d_is_dir()fs/notify/fanotify/fanotify.c include/linux/fsnotify.h+4 -10 replies
15/17fanotify: support events with data type FSNOTIFY_EVENT_INODEfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c+48 -242 replies
16/17fanotify: add support for create/attrib/move/delete eventsfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify_user.c include/linux/fanotify.h +1 more+48 -30 replies
17/17fanotify: report FAN_ONDIR to listener with FAN_REPORT_FIDfs/notify/fanotify/fanotify.c include/linux/fanotify.h+32 -40 replies

Reviews trailers per patch

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

Read the v5 thread

Cover letter [PATCH v5 00/17] fanotify: add support for more event types

Jan,

This is the 5th revision of patch series to add support for filesystem change monitoring to fanotify.

The complete work is available on fanotify_dirent-v5 branch [1] on github.

LTP tests by Matthew Bobrowski for FAN_REPORT_FID are available on my LTP branch fanotify_fid [2]. A WIP test for dirent events is available on my LTP branch fanotify_dirent [3].
Matthew Bobrowski is working on a proper test for dirent events and on man pages for both FAN_REPORT_FID and dirent events (Thanks!).

The combined functionality of FAN_MARK_FILESYSTEM, FAN_REPORT_FID and dirent modification events is demonstrated with a prototype of global filesystem monitor based on inotify-tools [4].

Thanks,
Amir.

Changes since v4:
- Rebase on v5.0-rc1
- Address style review comments on v4
- info_len includes padding to info_hdr alignment
- handle caching of fsid correctly when inotify marks on object exist
- Report dirent events on subdirs only with FAN_ONDIR
- Report XXX_SELF events on directories only with FAN_ONDIR
- Do not merge dirent events on subdirs with dirent events on non subdirs

[1] https://github.com/amir73il/linux/commits/fanotify_dirent-v5
[2] https://github.com/amir73il/ltp/commits/fanotify_fid
[3] https://github.com/amir73il/ltp/commits/fanotify_dirent
[4] https://github.com/amir73il/inotify-tools/commits/fanotify_dirent

Amir Goldstein (17):
fsnotify: annotate directory entry modification events
fsnotify: remove dirent events from FS_EVENTS_POSS_ON_CHILD mask
fsnotify: send all event types to super block marks
fsnotify: move mask out of struct fsnotify_event
fanotify: rename struct fanotify_{,perm_}event_info
fanotify: open code fill_event_metadata()
fanotify: encode file identifier for FAN_REPORT_FID
fanotify: copy event fid info to user
fanotify: enable FAN_REPORT_FID init flag
fanotify: cache fsid in fsnotify_mark_connector
vfs: add vfs_get_fsid() helper
fanotify: use vfs_get_fsid() helper instead of vfs_statfs()
fsnotify: report FS_ISDIR flag with MOVE_SELF and DELETE_SELF events
fanotify: check FS_ISDIR flag instead of d_is_dir()
fanotify: support events with data type FSNOTIFY_EVENT_INODE
fanotify: add support for create/attrib/move/delete events
fanotify: report FAN_ONDIR to listener with FAN_REPORT_FID

 fs/notify/fanotify/fanotify.c        | 229 +++++++++++++++++----
 fs/notify/fanotify/fanotify.h        | 105 ++++++++--
 fs/notify/fanotify/fanotify_user.c   | 288 +++++++++++++++++++--------
 fs/notify/fsnotify.c                 |  15 +-
 fs/notify/inotify/inotify.h          |   1 +
 fs/notify/inotify/inotify_fsnotify.c |  18 +-
 fs/notify/inotify/inotify_user.c     |   5 +-
 fs/notify/mark.c                     |  47 ++++-
 fs/notify/notification.c             |  22 +-
 fs/statfs.c                          |  14 ++
 include/linux/fanotify.h             |  26 ++-
 include/linux/fsnotify.h             |  94 +++++++--
 include/linux/fsnotify_backend.h     |  70 ++++---
 include/linux/statfs.h               |   3 +
 include/uapi/linux/fanotify.h        |  29 +++
 15 files changed, 753 insertions(+), 213 deletions(-)
Signature · 1 line
2.17.1