On Tue, May 28, 2024 at 12:11:52PM +0200, Jan Kara wrote:
So some fanotify users may use open_by_handle_at() and name_to_handle_at()
but we specifically designed fanotify to not depend on this mount id
feature of the API (because it wasn't really usable couple of years ago
when we were designing this with Amir). fanotify returns fsid + fhandle in
its events and userspace is expected to build a mapping of fsid ->
"whatever it needs to identify a filesystem" when placing fanotify marks.
If it wants to open file / directory where events happened, then this
usually means keeping fsid -> "some open fd on fs" mapping so that it can
then use open_by_handle_at() for opening.
Which seems like another argument for my version of the handles to
include the fsid. Although IIRC the fanotify fsid is only 64 bits which
isn't really good entropy, so we might have to rev that as well.