Hello Genodians
While debugging an error int the watch implementation of lx_fs, I observed, that fs_rom often closes and re-opens the watch handles.
Whenever the file is read, the watch is closed and then re-opened. This also happens, when the read was triggered by a watch notification from the file system.
Is there a special reason for that? Or is this an oversight?
In https://github.com/genodelabs/genode/issues/3897 Norman already stated, that fs_rom will probably undergo a rework to clean up some design issues he has spotted. If this is an oversight, I think it would be best to fix this when the rework is done.
Best regards, Pirmin
Hello Pirmin,
From what I remember, given that the watch notifications do not carry
any metadata on the nature of the notification (for better or worse), closing and reopening the handles is the best way for fs_rom to stay informed.
I believe the reasoning was that if a file exists and is watched, then a new file is "moved" to replace the watched file, a fresh watch handle needs to be opened. I think many text editors and other tools do this.
Cheers, Emery
Hello Emery
Thanks for the explanation. With this information I see, why closing and re-opening files on notification is required.
Cheers, Pirmin
On 11/3/20 10:57 AM, Emery Hemingway wrote:
Hello Pirmin,
From what I remember, given that the watch notifications do not carry any metadata on the nature of the notification (for better or worse), closing and reopening the handles is the best way for fs_rom to stay informed.
I believe the reasoning was that if a file exists and is watched, then a new file is "moved" to replace the watched file, a fresh watch handle needs to be opened. I think many text editors and other tools do this.
Cheers, Emery
Genode users mailing list users@lists.genode.org https://lists.genode.org/listinfo/users