Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755215AbZGXX1N (ORCPT ); Fri, 24 Jul 2009 19:27:13 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754136AbZGXX1N (ORCPT ); Fri, 24 Jul 2009 19:27:13 -0400 Received: from mx2.redhat.com ([66.187.237.31]:39607 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753531AbZGXX1M (ORCPT ); Fri, 24 Jul 2009 19:27:12 -0400 Subject: Re: fanotify - overall design before I start sending patches From: Eric Paris To: Jamie Lokier Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, malware-list@dmesg.printk.net, Valdis.Kletnieks@vt.edu, greg@kroah.com, jcm@redhat.com, douglas.leeder@sophos.com, tytso@mit.edu, arjan@infradead.org, david@lang.hm, jengelh@medozas.de, aviro@redhat.com, mrkafk@gmail.com, alexl@redhat.com, jack@suse.cz, tvrtko.ursulin@sophos.com, a.p.zijlstra@chello.nl, hch@infradead.org, alan@lxorguk.ukuu.org.uk, mmorley@hcl.in, pavel@suse.cz In-Reply-To: <20090724224813.GK27755@shareable.org> References: <1248466429.3567.82.camel@localhost> <20090724224813.GK27755@shareable.org> Content-Type: text/plain Date: Fri, 24 Jul 2009 19:25:51 -0400 Message-Id: <1248477951.3567.110.camel@localhost> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1716 Lines: 35 On Fri, 2009-07-24 at 23:48 +0100, Jamie Lokier wrote: > Eric Paris wrote: > > It is a new notification system that has a limited set of events (open, > > close, read, write) in which notification not only comes with metadata > > the describes what happened it also comes with an open file descriptor > > to the object in question. fanotify will also allow the listener to > > make access decisions on open and read events. This allows the > > implementation of hierarchical storage management systems or an access > > file scanning or integrity checking. > > My first thought was to wonder, why not make it the same set of events > that inotify and dnotify provide? That is: open, close, read, write, > create, delete, rename, attribute change? In other words, I don't see > a good reason for it to be a subset of events. The two real reasons? 1) These were the only 4 my original use case cared about. 2) These are the only 4 where the notification hook has enough information to open a fd in the context of the listener. In the kernel most notification is done with either an inode or a dentry as that is enough for inotify, dnotify, audit_watch and audit_tree. Opening a file descriptor, and thus fanotify, requires a dentry and a vfsmnt, which is much harder to come by in the kernel. Maybe as future work I'll try to convince Al to allow me to have that information in more places, but for today, those 4 are the only ones I can probably slip past him... -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/