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

From: Davide Libenzi
Date: Mon May 10 2004 - 18:50:13 EST


On Mon, 10 May 2004 Valdis.Kletnieks@xxxxxx wrote:

> 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?".

It'd be from a file* not from an inode* (where you have a dentry and a
vfsmount). So *one* path can be found.



> 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?

Yep, links are a problem to be implemented right. OTOH I don't think that
an rmap-fs can be asked only to solve such problem ;)



- Davide

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/