fuse-rs icon indicating copy to clipboard operation
fuse-rs copied to clipboard

Unknown FUSE opcode (39)

Open vi opened this issue 6 years ago • 8 comments

ioctl(TCGETS) on a file opened from a filesystem implemented with fuse-rc causes filesystem to be unmounted:

[2019-12-03T13:26:05Z ERROR fuse::request] Unknown FUSE opcode (39)
[2019-12-03T13:26:05Z INFO  fuse::session] Unmounted /tmp/m

Such ioctl is issued e.g. by git gui on file .git/HEAD for some reason.

Using Linux kernel version 4.19.85.

vi avatar Dec 03 '19 13:12 vi

I also got this error when doing dd if=<file_in_fuse_mount> skip=<some_offset> of=/dev/null.

mbilker avatar Dec 10 '19 19:12 mbilker

After checking the source code, that opcode is behind a feature flag: https://github.com/zargony/fuse-rs/blob/42e29d964e2b24e32e21b179b77e4d0d0a0857ac/fuse-abi/src/lib.rs#L275-L276

mbilker avatar Dec 10 '19 19:12 mbilker

Interesting. The kernel driver shouldn't send requests with this opcode at all since we're requesting ABI 7.8 in the FUSE_INIT reply.

zargony avatar Dec 11 '19 01:12 zargony

I am running Fedora 31 with Linux 5.3.12-300.fc31.x86_64 on the computer with my FUSE server program. According to the upstream Linux kernel source, there is no check against the server's ABI version when sending the IOCTL request [0].

[0] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/fs/fuse/file.c?h=v5.3.12#n2665

mbilker avatar Dec 11 '19 07:12 mbilker

Can it just safely ignore (ENOSYS) all unknown opcodes with only a warning instead of error?

vi avatar Dec 11 '19 23:12 vi

i'm also seeing this issue trying to open files with audacity. it's particularly frustrating that the filesystem immediately unmounts and i can't do anything about it, fuse-rs should handle this more gracefully.

ashkitten avatar Feb 07 '20 20:02 ashkitten

This looks like it might be easier to implement on the modernize branch. I got around this issue by defining the rest of the opcodes and basic parsing for them, but returns ENOSYS on opcodes that are not implemented.

mbilker avatar Feb 14 '20 00:02 mbilker

Hi all,

Until it's implemented in an actually decent fashion, you might use my quick'n dirty fork that I patched for this problem. Basically, it just replies a simple ENOSYS to any unknown request instead of Err-ing.

delehef avatar Apr 16 '20 09:04 delehef