From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH] VFS/inotify: send netlink messages when an inotify watch has been set or removed. Date: Sat, 7 Jan 2012 15:42:52 +0000 Message-ID: <20120107154252.GN23916@ZenIV.linux.org.uk> References: <4F084A4C.6080207@bononline.nl> <20120107143802.GM23916@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Stef Bon , linux-fsdevel@vger.kernel.org, rlove@rlove.org, eparis@parisplace.org To: Stef Bon Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:34329 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751548Ab2AGPmy (ORCPT ); Sat, 7 Jan 2012 10:42:54 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Jan 07, 2012 at 04:03:26PM +0100, Stef Bon wrote: > Futher, the FUSE fs knows it's own mountpoint. (ignore the submounts > on a FUSE fs here), it can filter out the watches which are set on the > fs. > This is not so hard right? What problems with "no way to tell at which > locations the damn thing happens to" you are pointing at?? Filesystem may be mounted at many places. The set of those locations depends on the process. It may change at any time. With no way for the filesystem to know about that (nor should it care, actually). See mount(2). Pay particular attention to MS_MOVE and MS_BIND flags (== --move and --bind in mount(8)). Moreover, it's not just maintaining the table of what is mounted where; different processes may bloody well have different sets of mounts. And even assuming we started sending notifications on *everything*, it still would not be enough - how is your FUSE server supposed to distinguish between * "add watch" notification sent * pathname argument of inotify_add_watch() resolved (down in inotify_find_inode()) * "mount --move" notification sent, mounted subtree moved and * "add watch" notification sent * "mount --move" notification sent, mounted subtree moved * pathname argument of inotify_add_watch() resolved (down in inotify_find_inode()) when the netlink traffic it sees is identical in both cases? And results are very much _not_ the same... IOW, what you are proposing is inherently racy.