Harvey-OS / ninep

Package for implementing clients and servers of the 9P and 9P2000 distributed resource protocols in Go.
Other
39 stars 19 forks source link

ufs fails on second connection #40

Closed gmacd closed 4 years ago

gmacd commented 5 years ago

If I launch ufs (./util/ufs -root=$HARVEY) then run GO9PCPU, the first time works fine, but if I leave ufs running, then launch GO9PCPU a second time, it fails to copy any files from ufs.

(I know I mention harvey, but it's probably a more general ninep/ufs bug)

gmacd commented 5 years ago

https://github.com/Harvey-OS/ninep/commit/ded6fcdedb454718f7f655006c89b8ea6953be17

I think it was this change that caused the problem.

Previously there would be one FileServer instance per connection, each instance with it's own fid->file map. Now there's just one FileServer instance for all connections, so fids can't be reused across connections (at least if the connection is abruptly dropped).

Perhaps going back to the previous arrangement of one fs per connection is a solution. Alternatively ensure fids aren't reused?

What's a good solution for this?