mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jamie Lokier <lk@tantalophile.demon.co.uk>
To: Daniel Phillips <phillips@bonn-fries.net>
Cc: Malte Starostik <malte@kde.org>, linux-kernel@vger.kernel.org
Subject: Re: directory notifications lost after fork?
Date: Tue, 12 Mar 2002 17:21:01 +0000	[thread overview]
Message-ID: <20020312172101.A5075@kushida.apsleyroad.org> (raw)
In-Reply-To: <200203120247.05611.malte@kde.org> <20020312125543.B4281@kushida.apsleyroad.org> <E16kpHc-0002Lx-00@starship>
In-Reply-To: <E16kpHc-0002Lx-00@starship>; from phillips@bonn-fries.net on Tue, Mar 12, 2002 at 05:37:51PM +0100

Daniel Phillips wrote:
> On March 12, 2002 01:55 pm, Jamie Lokier wrote:
> >    - dnotify causes files to notify their parent directory (yes it's
> >      ambiguous with hard links).
> 
> That's a bitch, isn't it?  The only way I can think of to deal with it
> is via a hardlink reverse map, and there are lots of worms in that
> can, including where you store it, how much it costs to maintain it,
> how persistent it should be and how to make it perfectly non-racy.

For dnotify purposes this may be solvable without a full reverse map.
Suppose that we have per-inode notifiers as I suggested, and as the imon
patch implements.  Of course, multiple listeners can attach to an
inode's notifier chain -- this is needed to support multiple processes
listening.

Then you can implement dnotify by attaching the parent directory as a
listener to each of its child inodes.  (It's a bit heavy to set up,
though).

Now, when an inode is modifed we don't guarantee to notify all the
parent directories...  but we do guarantee to notify all the ones which
are actually listening at the moment.  So it's a partial reverse map.  I
expect Al Viro would have something to say about dcache races at this
point.

For recursive parent notification, such as monitoring "/usr" to learn
about changes anywhere underneath "/usr", the above is perhaps
impractical.  We're right back to having to do "find -print" equivalent
disk activity.  Or reverse maps in the filesystem.  Ugh.

In practice I'd just give up trying to cache stat() results of hard
linked files, unless I knew I'd found all the paths to those files.
Just don't use hard links ;-)

cheers,
-- Jamie



  reply	other threads:[~2002-03-12 17:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-12  1:47 Malte Starostik
2002-03-12 12:55 ` Jamie Lokier
2002-03-12 16:37   ` Daniel Phillips
2002-03-12 17:21     ` Jamie Lokier [this message]
     [not found] <20020311122701.A9718@riesen-pc.gr05.synopsys.com>
2002-03-11 19:34 ` Alex Riesen
  -- strict thread matches above, loose matches on Subject: below --
2002-03-10 21:08 Oskar Liljeblad
2002-03-11  7:41 ` Alex Riesen
2002-03-12 12:19   ` Jamie Lokier
2002-03-11  8:50 ` Oskar Liljeblad
2002-03-11 10:20   ` Alex Riesen
2002-03-11 10:26 ` Andrea Arcangeli
2002-03-12  1:04 ` Stephen Rothwell
2002-03-12  1:20   ` Andrea Arcangeli
2002-03-12  2:59   ` Stephen Rothwell
2002-03-12  4:01     ` Andrea Arcangeli

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=20020312172101.A5075@kushida.apsleyroad.org \
    --to=lk@tantalophile.demon.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malte@kde.org \
    --cc=phillips@bonn-fries.net \
    /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

all inboxes | Powered by JetHome®