Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1603791 > unrolled thread

Re: fanotify and namespaces/bind mounts

Started byriya khanna <riyakhanna1983@gmail.com>
First post2017-03-18 15:20 +0100
Last post2017-03-18 15:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: fanotify and namespaces/bind mounts riya khanna <riyakhanna1983@gmail.com> - 2017-03-18 15:20 +0100

#1603791 — Re: fanotify and namespaces/bind mounts

Fromriya khanna <riyakhanna1983@gmail.com>
Date2017-03-18 15:20 +0100
SubjectRe: fanotify and namespaces/bind mounts
Message-ID<tmnn3-7xG-3@gated-at.bofh.it>
Are fsnotify events generated per mount namespace?

On Thu, Oct 29, 2015 at 9:29 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
>
> If I call fanotify_mark(... FAN_MARK_ADD | FAN_MARK_MOUNT ...), I get
> notifications on all files on the file system.
>
> Except I don't.
>
> If a process has mounted directories on the file system in a different
> namespace, the global namespace experiences file system events but no
> fanotify events are generated. A similar limitation applies to bind
> mounts.
>
> You can easily see this behavior in action. Do "man fanotify", and copy
> the example program to, say, example.c. Then,
>
>     cc -o example example.c
>     mkdir -p /mnt/xyz
>     mount -o bind /root /mnt/xyz
>     ./example /root
>
> The last command prints out fanotify events. It will display events for
>
>     touch /root/xyzzy
>
> but nothing for
>
>     touch /mnt/xyz/zyxxy
>
> or
>
>     unshare -m touch /root/yxyyx
>
> Should the current situation be considered a bug in fanotify? Or is
> there another recommended way to monitor file system events
> categorigally?
>
>
> Marko
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web