Skip to content

RFC Monitoring unmounted fs with fanotify

Amir Goldstein linux-api linux-fsdevel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 13 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2fanotify: add support for FAN_UNMOUNT eventfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c +3 more+40 -63 replies
2/2fanotify: report mntid info record with FAN_UNMOUNT eventsfs/notify/fanotify/fanotify.c fs/notify/fanotify/fanotify.h fs/notify/fanotify/fanotify_user.c +1 more+97 -142 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [RFC][PATCH 0/2] Monitoring unmounted fs with fanotify

Jan,

Followup on my quest to close the gap with inotify functionality, here is a proposal for FAN_UNMOUNT event.

I have had many design questions about this:
1) Should we also report FAN_UNMOUNT for marked inodes and sb on sb shutdown (same as IN_UNMOUNT)?
2) Should we also report FAN_UNMOUNT on sb mark for any unmounts of that sb?
3) Should we report also the fid of the mount root? and if we do...
4) Should we report/consider FAN_ONDIR filter?

All of the questions above I answered "not unless somebody requests" in this first RFC.

Specifically, I did get a request for an unmount event for containers use case.

I have also had doubts regarding the info records.
I decided that reporting fsid and mntid is minimum, but couldn't decide if they were better of in a single MNTID record or seprate records.

I went with separate records, because:
a) FAN_FS_ERROR has set a precendent of separate fid record with fsid and empty fid, so I followed this precendent
b) MNTID record we may want to add later with FAN_REPORT_MNTID to all the path events, so better that it is independent

There is test for the proposed API extention [1].

Thoughts?

Thanks,
Amir.

[1] https://github.com/amir73il/ltp/commits/fan_unmount

Amir Goldstein (2):
fanotify: add support for FAN_UNMOUNT event
fanotify: report mntid info record with FAN_UNMOUNT events

 fs/notify/fanotify/fanotify.c      | 45 +++++++++++++++++++-------
 fs/notify/fanotify/fanotify.h      | 26 +++++++++++++--
 fs/notify/fanotify/fanotify_user.c | 52 ++++++++++++++++++++++++++++--
 include/linux/fanotify.h           |  3 +-
 include/linux/fsnotify.h           | 16 +++++++++
 include/uapi/linux/fanotify.h      | 11 +++++++
 6 files changed, 135 insertions(+), 18 deletions(-)
Signature · 1 line
2.34.1