From: Nikolaus R. <Nik...@ra...> - 2012-05-23 15:07:04
|
JT Olds <jto...@pu...> writes: > I had a conversation with some folks in the GTK channel about how > Gnome does file monitoring, and it sounds like the current best > practice for my use case is to do this: > > 1) If a local client is creating a file, proceed as usual. Its posix > call will hit the fuse layer through the kernel and the kernel will > trigger events. > 2) If a remote client is creating a file, the process with the fuse > extensions will know about the created file, but instead of simply > making the file exist to future readdir and getattr calls, keep the > file hidden from the remote file system, and issue a posix call to > itself to create the file, thus unmasking the file. This causes the > kernel to know about the file's creation and trigger events. To me this sounds like the best you can possibly do in this situation, (and I'm not sure why an additional overlay file system would be useful in either case). What race conditions are you worried about? If a local client accesses a file that has been created remotely before you have unmasked it, the situation is not different from the client accessing it before the remote change has made it through the network. Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C |