linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 0/2] Monitoring unmounted fs with fanotify
@ 2023-04-14 18:29 Amir Goldstein
  2023-04-14 18:29 ` [RFC][PATCH 1/2] fanotify: add support for FAN_UNMOUNT event Amir Goldstein
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Amir Goldstein @ 2023-04-14 18:29 UTC (permalink / raw)
  To: Jan Kara; +Cc: Matthew Bobrowski, Christian Brauner, linux-fsdevel, linux-api

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(-)

-- 
2.34.1


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

end of thread, other threads:[~2023-04-20  8:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-14 18:29 [RFC][PATCH 0/2] Monitoring unmounted fs with fanotify Amir Goldstein
2023-04-14 18:29 ` [RFC][PATCH 1/2] fanotify: add support for FAN_UNMOUNT event Amir Goldstein
2023-04-18 13:43   ` Christian Brauner
2023-04-19 13:14   ` Jan Kara
2023-04-19 18:32     ` Amir Goldstein
2023-04-14 18:29 ` [RFC][PATCH 2/2] fanotify: report mntid info record with FAN_UNMOUNT events Amir Goldstein
2023-04-17  8:38   ` Amir Goldstein
2023-04-19 13:30   ` Jan Kara
2023-04-18 13:33 ` [RFC][PATCH 0/2] Monitoring unmounted fs with fanotify Christian Brauner
2023-04-18 13:56   ` Amir Goldstein
2023-04-18 14:12     ` Christian Brauner
2023-04-18 15:20       ` Amir Goldstein
2023-04-19 17:19         ` Christian Brauner
2023-04-20  6:12           ` Amir Goldstein
2023-04-20  7:46             ` Christian Brauner
2023-04-20  8:15               ` Amir Goldstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).