fuse: invalidate kernel page cache when files not changed via fuse
In the fuse mount we might run in the following situation:
- User creates file over
brig stage /file - User reads file over fuse. This will make the kernel cache (parts of) it.
- User modifies the file over
brig stage /filewith new data. - User reads file over fuse again. This will return the old data coming from the page cache.
- User waits some time.
- User reads file over fuse again. This will return the new data.
Similar scenarios can be thought of regarding syncing and using the fuse file system. From my POV this is not critical since the situation resolves itself after a short time. There might be quite a bit of confusion though and also scripting is annoying due to that property.
Whenever a file is staged over catfs (and it's not coming from the fuse layer) then we gonna need to call fuse.InvalidateNodeData() on that particular file to make the kernel forget the cached pages and ask our filesystem for the new content. The implementation should be made in a generic way, to not couple fuse and catfs.
(The issue was originally discovered here: https://github.com/sahib/brig/pull/93)