All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Amir Goldstein <amir73il@gmail.com>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	Lino Sanfilippo <LinoSanfilippo@gmx.de>,
	Eric Paris <eparis@redhat.com>, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [RFC][PATCH 0/7] fanotify: add support for more events
Date: Tue, 11 Oct 2016 13:32:56 +0200	[thread overview]
Message-ID: <20161011113256.GI6952@quack2.suse.cz> (raw)
In-Reply-To: <1476126784-12520-1-git-send-email-amir73il@gmail.com>

Hi,

On Mon 10-10-16 22:12:57, Amir Goldstein wrote:
> This series is a prep work for using fanotify to monitor all
> events in a file system with a single watch.
> 
> The end result is indented to be an alternative to the recursive
> inotify watches scheme, which has its problems.
> 
> This first part adds support for most inotify events to fanotify
> when watching a directory.

Well, and how is this better than what inotify supports? The proclaimed
advantage of fanotify() was that you get open file handle in the event
which prevents races when directory tree changes before you manage to
process inotify event. However with directory changes, you are again
starting to report names and so things become racy again. So I don't quite
see a value of reimplementing this in fanotify. The only benefit I see is
that you can watch the whole mountpoint with one watch instead of having to
add watch to every directory. Is that such a huge win? What is a use case
for that?

> The next part will add support for watching a super block,
> which is not the same as watching a mount point.

Careful here. In the world of user namespaces and containers you have to be
really careful so that events from one container don't leak into another
container despite they live in the same physical filesystem, just a
different bind mount. I believe chroot / bind mounts was one of the reasons
why fanotify ended with mountpoints and not with superblocks. But I guess
Eric or Al remember this better.

> I am posting this WIP to get feedback on the idea and to find
> out if there are any users out there interested in the improved
> fanotify capabilities and/or in the super block monitoring
> use case.

Well, I hope you have some usecases in mind when you propose this ;) I've
been asked about fanotify for superblocks but so far I think that doing it
in kernel would be a headache (mostly security-wise) and doing it in
userspace - watch every mountpoint in /proc/mounts - may be less
error-prone.

								Honza

> 
> Amir Goldstein (7):
>   fsnotify: pass dentry instead of inode when available
>   fsnotify: annotate filename events
>   fanotify: new init flag FAN_EVENT_INFO_PARENT
>   fanotify: store mount point from which an inode watch was added
>   fanotify: support events with data type FSNOTIFY_EVENT_DENTRY
>   fanotify: add support for create/attrib/rename/delete events
>   fanotify: pass filename info for filename events
> 
>  fs/notify/fanotify/fanotify.c      | 85 +++++++++++++++++++++++++++++++----
>  fs/notify/fanotify/fanotify.h      | 24 +++++++++-
>  fs/notify/fanotify/fanotify_user.c | 92 ++++++++++++++++++++++++++++++++++----
>  fs/notify/fdinfo.c                 |  4 +-
>  fs/notify/fsnotify.c               |  2 +-
>  fs/notify/inode_mark.c             |  1 +
>  fs/notify/mark.c                   | 15 +++++--
>  include/linux/fsnotify.h           | 46 ++++++++++++++-----
>  include/linux/fsnotify_backend.h   | 24 +++++++---
>  include/uapi/linux/fanotify.h      | 41 ++++++++++++++---
>  10 files changed, 287 insertions(+), 47 deletions(-)
> 
> -- 
> 2.7.4
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  parent reply	other threads:[~2016-10-11 18:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 19:12 [RFC][PATCH 0/7] fanotify: add support for more events Amir Goldstein
2016-10-10 19:12 ` [RFC][PATCH 1/7] fsnotify: pass dentry instead of inode when available Amir Goldstein
2016-10-10 19:12 ` [RFC][PATCH 2/7] fsnotify: annotate filename events Amir Goldstein
2016-10-10 19:13 ` [RFC][PATCH 3/7] fanotify: new init flag FAN_EVENT_INFO_PARENT Amir Goldstein
2016-10-10 19:13 ` [RFC][PATCH 4/7] fanotify: store mount point from which an inode watch was added Amir Goldstein
2016-10-10 19:13 ` [RFC][PATCH 5/7] fanotify: support events with data type FSNOTIFY_EVENT_DENTRY Amir Goldstein
2016-10-10 19:13 ` [RFC][PATCH 6/7] fanotify: add support for create/attrib/rename/delete events Amir Goldstein
2016-10-10 19:13 ` [RFC][PATCH 7/7] fanotify: pass filename info for filename events Amir Goldstein
2016-10-11  7:00 ` [RFC][PATCH 0/7] fanotify: add support for more events Amir Goldstein
2016-10-11 11:32 ` Jan Kara [this message]
2016-10-12 11:49   ` Amir Goldstein
  -- strict thread matches above, loose matches on Subject: below --
2016-10-13 17:35 Marko Rauhamaa
2016-10-13 18:42 ` Amir Goldstein
2016-10-14  8:28   ` Marko Rauhamaa
2016-10-15 15:23     ` Amir Goldstein
2016-10-17  8:43       ` Marko Rauhamaa
2016-12-09  9:14   ` Amir Goldstein
2016-12-09 13:16     ` Marko Rauhamaa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161011113256.GI6952@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=LinoSanfilippo@gmx.de \
    --cc=amir73il@gmail.com \
    --cc=eparis@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.