Re: [RFC 2/2] fanotify: emit FAN_MODIFY_DIR on filesystem changes

2017-03-20 Thread Filip Štědronský
Hi, On Sun, Mar 19, 2017 at 07:04:13PM +0100, Jan Kara wrote: > How come? In current kernel the call looks like: > > vfs_mknod(d_inode(path.dentry), dentry, mode, dev->devt); > > so the path is available there... I've actually quickly checked all > vfs_mknod() callers and they all seem to have p

Re: [RFC 2/2] fanotify: emit FAN_MODIFY_DIR on filesystem changes

2017-03-19 Thread Filip Štědronský
On Sun, Mar 19, 2017 at 11:19:43AM +0100, Jan Kara wrote: > However if you can really call fsnotify hooks with 'path' available in all > the places, it should be equally hard to just pass 'path' to > vfs_(create|mkdir|...) and that way we don't have to sprinkle fsnotify > calls into several call si

Re: [RFC 2/2] fanotify: emit FAN_MODIFY_DIR on filesystem changes

2017-03-14 Thread Filip Štědronský
Hi, On Tue, Mar 14, 2017 at 01:18:01PM +0200, Amir Goldstein wrote: > I claim that fanotify filters event by mount not because it > was a requirement, but because it was an implementation challenge > to do otherwise. > > And I claim that what mount watchers are really interested in is > "all the c

Re: [RFC 1/2] fanotify: new event FAN_MODIFY_DIR

2017-03-14 Thread Filip Štědronský
Hi, On Tue, Mar 14, 2017 at 03:55:19PM +0200, Amir Goldstein wrote: > Please let me know if that is sufficient for your needs > or if you need me to prepare a version that delivers filename events > without filename info, therefore allowing to merge filename events. > > Sounds to me like if you g

Re: [RFC 1/2] fanotify: new event FAN_MODIFY_DIR

2017-03-14 Thread Filip Štědronský
Hi, On Tue, Mar 14, 2017 at 12:40:56PM +0200, Amir Goldstein wrote: > An I am very happy that you used filehandles to keep track of objects > in your example, because it fits my proposal really well. you can read more about the rationales in the WIP draft of my thesis (especially the chapter Iden

Re: [RFC 1/2] fanotify: new event FAN_MODIFY_DIR

2017-03-14 Thread Filip Štědronský
Hi, On Tue, Mar 14, 2017 at 12:11:40PM +0200, Amir Goldstein wrote: > > - file system indexers / desktop search tools > > - file synchronization tools (like Dropbox, Nextcloud, etc.), > > online backup tools > > This last one is the use case of my employer, Ctera Networks. > Out of curios

Re: [RFC 1/2] fanotify: new event FAN_MODIFY_DIR

2017-03-13 Thread Filip Štědronský
An example userspace program that uses FAN_MODIFY_DIR to reliably keep an up-to-date internal representation of the file system. It uses some filehandle trickery to identify inodes, other heuristics could be also used. --- //#define _GNU_SOURCE #include #include #include #include #include #

[RFC 2/2] fanotify: emit FAN_MODIFY_DIR on filesystem changes

2017-03-13 Thread Filip Štědronský
') Signed-off-by: Filip Štědronský --- An alternative might be to create wrapper functions like vfs_path_(rename|unlink|...). They could also take care of calling security_path_(rename|unlink|...), which is currently also up to the indvidual callers (possibly with a flag because it might no

[RFC 1/2] fanotify: new event FAN_MODIFY_DIR

2017-03-13 Thread Filip Štědronský
ations on a directory (e.g. deleting all files). Signed-off-by: Filip Štědronský --- An alternative might be to create wrapper functions like vfs_path_(rename|unlink|...). They could also take care of calling security_path_(rename|unlink|...), which is currently also up to the indvidual caller