cberner / fuser

Filesystem in Userspace (FUSE) for Rust
MIT License
835 stars 114 forks source link

Fuse library hangs on Channel::receive, interactions with mountpoint fail with 'Input/output error' #226

Closed IntrepidPig closed 1 year ago

IntrepidPig commented 1 year ago

I don't really think this is a bug with this library, but I'm posting this issue in the hopes of finding some debugging guidance since I've been stuck on this for ages. For reasons I can't figure out, after passing a few requests and replies successfully, my code hangs forever on the read call in fuser::channel::Channel::receive. Trying ls/stat on the mountpoint fails immediately with 'Input/output error'. Is there a well-known cause for this type of behavior? My implementation is very early still, so lots of the filesystem is just made of stub implementations, but I can't see why any particular stand-in reply I give would cause this.

Any advice would be greatly appreciated, and I'm sorry for polluting the issue tracker with something that is probably not an issue with the library itself at all.

hopkings2008 commented 1 year ago

Before your codes hangs, does the former request return successfully? Currently, as far as i know, the event loop which processes the events from kernel is 'single threaded', so, if the former request doesn't return, the later request will hang. You must check your code to make sure that the former request returns successfully.

IntrepidPig commented 1 year ago

Thank you so much, you helped me figure this out after being stuck for weeks. It didn't appear like any requests were failing, but after fiddling with things I found that a getattr call would be successful once and then the program would hang. Then, after going over my implementation with the inode manpage open on at the same time, I realized I had switched up the mode value I was putting in my attributes for directories and files. After fixing that, fuse no longer hangs. I slightly want to bang my head against a wall, but I am also so grateful to you for pointing me in the right direction!