NotifysupportFuse
From BononWiki
August 2011
I've found out that the solution to make inotify work lies in a wrapper in glibc. Like any other syscall it's possible to write a wrapper here. On my system it's about the following:
inotify_init inotify_add_watch inotify_remove_watch
Whenever inotify_init is called, the wrapper should find out the inode/path is on a filesystem like FUSE, cifs, nfs or any other network filesystem, an inotify fd/connection has to be setup with the system responsible for the filesystem. For fuse that is the FUSE fs, for cifs that is mount.cifs in stead of with the VFS.
So the filesystem self becomes responsible for handling the inotify_init and the add_watch and remove_watch calls.
June 2011
Some time ago I've posted a message at the Linux fs devel list:
As you can read here, there is some resistance to making inotify work work fs's like the ones based on FUSE and cifs. I think I did not explain that well what my idea is. I donot want to make inotify work for every fs, I want them to be able to forward the inotify call into a protocol specific call, translate any received event back to inotify and report that to the VFS.
So, I want them to be able to do something with the fact that a client sends a inotify request for an inode (sets a watch) on a mounted filesystem, where this is of the kind I've mentioned above.
Now the filesystems do not recieve this kind of info. It's blocked/not supported somewhere. If the filesystem receives this kind of requests, it can than take the proper action, ie translate the inotify request to a request/call specific for the protocol in use. For cifs that would be a SMB/SMB2 call:
Article about SMB notify support
When receiving info, the fs should translate it back to a inotify event, and sand that back to the VFS.
Something simular for NFS, and very fs specific for FUSE fs's.
In short:
. the mounted fs's should be informed by the VFS a inotify watch has been set on a inode. The filesystem should receive full info about what kind of watch/mask.
. the VFS should be able to listen to events reported by the fs's.
. the filesystem's have to translate the inotify request into a protocol/backend specific call, and be able to listen to events send by the backend
. the filesystem has to translate these protocol specific events back to inotify format and send that back to the VFS, the original watch.
NOTE 1: It's very possible that the cifs supports something that looks a lot like dnotify. The comments I've read say that more or less. As far as I've understood the initiative on making dnotify work came from the developers of Samba.
Resources not mentioned but interesting: