Re: [RFC/PATCH] inotify -- a dnotify replacement

From: Valdis . Kletnieks
Date: Mon May 10 2004 - 18:16:34 EST


On Mon, 10 May 2004 15:52:58 PDT, Davide Libenzi said:

> And it should not even be that much hard to do, since you can just
> backtrace the the point where the change happened to see if there are
> watchers on the parent directories.

Umm.. can you? That sounds suspiciously like "given an inode, how
do I find the pathname?".

How do you handle the case of a file that's hard-linked into 2 different
directories a "long way" apart in the heirarchy? It's easy enough to
backtrack and find *A* path - the problem is if the watcher was on
some *other* directory:

mkdir -p /tmp/a/foo/bar/baz
mkdir -p /tmp/b/que/er/ty
touch /tmp/a/foo/bar/baz/flag
ln /tmp/a/foo/bar/baz/flag /tmp/b/qu/er/ty/flag

If you modify 'flag' again, how do you ensure that you find a watcher on
/tmp/a/foo or /tmp/b/qu, given that either or both might be there?

Attachment: pgp00000.pgp
Description: PGP signature