SerCeMan / jnr-fuse

FUSE implementation in Java using Java Native Runtime (JNR)
MIT License
365 stars 87 forks source link

File system freezes in the rename method #85

Closed arvgord closed 4 years ago

arvgord commented 4 years ago

Hi, @SerCeMan.

I found that a file system freezes in the rename method when I try to get all files in the selected folder(I need to check that a folder is empty before renaming) using Files.newDirectoryStream(some_folder)(or another method). I reproduced this in the jnr-fuse MemoryFs example.
test-rename

SerCeMan commented 4 years ago

Hey, @arvgord! Can it be that you're trying to invoke fuse from fuse?

arvgord commented 4 years ago

Yes, that's right.

SerCeMan commented 4 years ago

Hey, @arvgord! Sorry for the delay, I believe that's expected behaviour. As far as I can see from the code sample, the rename method tries to operate on a higher level than it should by performing a syscall rather than manipulating the structure directly. For instance, in this case what rename is expected to do in the MemoryFs example is to manipulate the in-memory structure so that the next read can see observe the file at the new location.

SerCeMan commented 4 years ago

I'm going ahead and closing this issue now, but feel free to reopen if you see any issues with jnr-fuse :)