linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stef Bon <stefbon@gmail.com>
To: Brad Boyer <flar@allandria.com>
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: Question about inotify and bind mount.
Date: Mon, 7 Jun 2010 11:23:54 +0200	[thread overview]
Message-ID: <AANLkTimMsPJNmepOIRMFZ3CxiRTH65fePLHAMMMJnqc-@mail.gmail.com> (raw)
In-Reply-To: <20100607081309.GA21892@cynthia.pants.nu>

2010/6/7 Brad Boyer <flar@allandria.com>:
> On Sun, Jun 06, 2010 at 12:55:35PM +0200, Stef Bon wrote:
>> Yes I know what you mean, I hope...
>> You mean there is a inotify structure necessary to handle inotify
>> requests, and for the driver (a FUSE fs or cifs for SMB to name some)
>> to act on this request.
>
> Each inode structure in the kernel has a list of outstanding inotify
> watch requests, each of which is an inotify_watch structure.

Each inode?? Sounds like a lot.
I thought only the inodes when asked.

>Each
> inode structure also has a bitmask of any event types in use by an
> active watch (this is i_fsnotify_mask in struct inode). Currently
> the driver isn't told in any way when these things change. The
> driver also isn't given the opportunity to tell the user that
> some event types may not actually work properly. If the driver was
> notified when the event mask changed, it could send a request to
> the server (in the case of CIFS, at least) to start sending
> messages for events of those types. Those messages would then need
> to be converted and passed to the fsnotify layer in some way. There
> are some functions for that part, but they don't really seem to be
> designed for this type of use.

This is the same push versus pull dilemma. Changes in the fs when
dealing with a network fs or a fuse fs
has to be pushed to the local inotify by the remote server (in case of
network fs) or by the fuse fs somehowe
because the local inotify subsystem cannot do that.

My fs is an fuse overlay fs, and the notify subsystem cannot
detect/"understand" in any way that changes in the underlying fs are
related to changes in my fuse fs.

So my fs needs some structure to map inotify watch requests to watch
requests at the underlying fs.
These watches on the underlying fs need to be monitored (with epoll
for example) and when there is activity (=changes) these should be
forwarded to the related watches on the fuse fs.
Not one to one, because my fs makes changes the behaviour of the
underlying fs in some aspects. (otherwise I would simply use a bind
mount....).

>
> When you create a bind mount, the same inode structures are used both
> for the orginal mount and the bind mount. This means that no matter
> which path you use for lookup, the kernel finds the same inode.

Ok I understand.

Thanks a lot,

Stef

  parent reply	other threads:[~2010-06-07  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-01  9:49 Question about inotify and bind mount Stef Bon
2010-06-06  4:26 ` Brad Boyer
2010-06-06 10:55   ` Stef Bon
2010-06-07  8:13     ` Brad Boyer
2010-06-07  8:50       ` Jamie Lokier
2010-06-07  9:23       ` Stef Bon [this message]
2010-06-10  5:52         ` Brad Boyer
2010-06-10 21:18     ` Al Viro

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=AANLkTimMsPJNmepOIRMFZ3CxiRTH65fePLHAMMMJnqc-@mail.gmail.com \
    --to=stefbon@gmail.com \
    --cc=flar@allandria.com \
    --cc=linux-fsdevel@vger.kernel.org \
    /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 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).