Open volo-droid opened 2 years ago
Looking at the code, I would say it requires a major refactoring in a few places like VMWSharedFolders
and VMWNode
. It might be worth trying to port open-vm-tools instead (or at least their hgfs implementation).
What kind of refactoring is needed?
It might be worth trying to port open-vm-tools instead (or at least their hgfs implementation).
It's actually too much work as open-vm-tools has a lot of components to port.
What kind of refactoring is needed?
First of all, there's a use-after-free bug somewhere in the code, which I wasn't able to find. To simplify debugging and fixing of issues like that it makes sense to rewrite the filesystem driver as UserlandFS/FUSE (FUSE implementation from open-vm-tools might provide some help there), also currently the project uses VmWare filesystem version 1 which is slow and a bit limited, so that would also need to be updated (and again, the headers from the open-vm-tools can speed it up).
There seems to be a working driver from open-vm-tools ported to Haiku here https://github.com/trungnt2910/open-vm-tools
The FUSE driver from that port is known to work. That said, there are some certain quirks (I can't remember what since it's been quite a while since I used that driver myself).
The port itself has a few stubs here and there, for example in scripts/haiku/network. There may be some other stubs I have forgotten that might or might not affect the hgfs
driver.
The filesystem driver doesn't appear to use any locking at all. That's probably the source of the crashes.
The FUSE driver from that port is known to work. That said, there are some certain quirks (I can't remember what since it's been quite a while since I used that driver myself).
Well done! Would you be up for upstreaming it? The open-vm-tool team welcomes porting the project to new operating systems.
Would @trungnt2910's port be recommended over these add-ons in general at this point? Is a recipe available?
The current vmware_fs implementation seems to be quite buggy, and fails under extensive usage:
Crash 1:
Crash 2:
Crash 3:
The problem seems to be in the VMWNode children management logic, it looks like some nodes are used after their memory has been freed.