All of lore.kernel.org
 help / color / mirror / Atom feed
* adding mount notification to fanotify?
@ 2022-05-05  4:28 Miklos Szeredi
  2022-05-05  5:41 ` Amir Goldstein
  0 siblings, 1 reply; 3+ messages in thread
From: Miklos Szeredi @ 2022-05-05  4:28 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Amir Goldstein, Jan Kara, David Howells

Here's David's patch, which introduces new infrastructure for this purpose:

https://lore.kernel.org/all/158204559631.3299825.5358385352169781990.stgit@warthog.procyon.org.uk/

I'm wondering if this could be added to fsnotify/fanotify instead?

After all, the events are very similar, except it's changes to the
mount tree, not the dentry tree that need to be reported.

Thanks,
Miklos

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

* Re: adding mount notification to fanotify?
  2022-05-05  4:28 adding mount notification to fanotify? Miklos Szeredi
@ 2022-05-05  5:41 ` Amir Goldstein
  2022-05-05  8:58   ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Amir Goldstein @ 2022-05-05  5:41 UTC (permalink / raw)
  To: Miklos Szeredi; +Cc: linux-fsdevel, Jan Kara, David Howells

On Thu, May 5, 2022 at 7:28 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> Here's David's patch, which introduces new infrastructure for this purpose:
>
> https://lore.kernel.org/all/158204559631.3299825.5358385352169781990.stgit@warthog.procyon.org.uk/
>
> I'm wondering if this could be added to fsnotify/fanotify instead?

I suppose we could.
Speaking of David's patch, I think that getting fanotify events via watch_queue
instead of read() could also be a nice improvement.

>
> After all, the events are very similar, except it's changes to the
> mount tree, not the dentry tree that need to be reported.
>

There is already one precedent to event on mount tree change in fsnotify -
inotify IN_UNMOUNT

Thanks,
Amir.

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

* Re: adding mount notification to fanotify?
  2022-05-05  5:41 ` Amir Goldstein
@ 2022-05-05  8:58   ` Jan Kara
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kara @ 2022-05-05  8:58 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: Miklos Szeredi, linux-fsdevel, Jan Kara, David Howells

On Thu 05-05-22 08:41:09, Amir Goldstein wrote:
> On Thu, May 5, 2022 at 7:28 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
> >
> > Here's David's patch, which introduces new infrastructure for this purpose:
> >
> > https://lore.kernel.org/all/158204559631.3299825.5358385352169781990.stgit@warthog.procyon.org.uk/
> >
> > I'm wondering if this could be added to fsnotify/fanotify instead?
> 
> I suppose we could.

I'm not so sure. We could definitely add fanotify event for changes in the
superblock (like watch for RO vs RW state, mount option changes, etc. of a
particular sb). However the general "was anything mounted/unmounted in the
subtree of this mount" seems to have rather different properties than
common fanotify events. For fanotify if would be natural to have events
like "was anything mounted on this dir?" or "was anything mounted on some
dir of this superblock?". Besides this philosophical objection,
communicating general "something got mounted in the subtree" through
fanotify has the problem that we would have hard time gathering and
reporting what has changed and where information - that would basically
require completely separate info structures attached to events. So there is
some overlap but I'm not sure it is large enough.

>  Speaking of David's patch, I think that getting
> fanotify events via watch_queue instead of read() could also be a nice
> improvement.

What would be advantages?

> > After all, the events are very similar, except it's changes to the
> > mount tree, not the dentry tree that need to be reported.
> >
> 
> There is already one precedent to event on mount tree change in fsnotify -
> inotify IN_UNMOUNT

Yes, events for superblock have precedent. But since fanotify is all build
around watches on objects, I'm not sure general mount notification really
fits well.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2022-05-05  8:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-05  4:28 adding mount notification to fanotify? Miklos Szeredi
2022-05-05  5:41 ` Amir Goldstein
2022-05-05  8:58   ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.