[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20081222232040.GP28946@ZenIV.linux.org.uk>
Date: Mon, 22 Dec 2008 23:20:40 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: "C. Scott Ananian" <cscott@...top.org>
Cc: Eric Paris <eparis@...hat.com>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH -v4 00/14] fsnotify, dnotify, and inotify
On Mon, Dec 22, 2008 at 06:08:08PM -0500, C. Scott Ananian wrote:
> That's not correct, as /proc/self/fd/<num> and the getcwd syscall make
> clear. struct inode has a i_dentry member, and via its d_parent links
> you can reconstruct the path, as __d_path in fs/dcache.c does.
Think for a minute
a) you might have any number of links to given inode, *including* *zero*
b) any subset of these links may be in dcache (including empty)
c) any number of bindings might exist to file in question *or* to its
ancestors (again, including zero).
d) none of the relative paths from fs root to file has to be visible
as a path leading to file in question from anywhere (again, think of
bindings)
e) all of that can change before information reaches userland.
> inotify *almost* lets us do that last thing (though the code
> duplication pains me) but is too racy for reliable use. Give me a
> kernel interface without races and I'll call it a good start. If you
> can save me the trouble of duplicating all of the filesystem's
> directory information in my userspace database in order to handle
> directory moves, I'll actually grin a little.
_WHAT_ interface without races? Anything along the lines of "somebody had
done something to <pathname>" is racy by definition. Simply because the
next operation might have changed the mapping from pathnames to files.
What are you actually trying to do?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists