Page MenuHomeFreeBSD

fusefs: update FUSE protocol to 7.24 and implement FUSE_LSEEK
ClosedPublic

Authored by asomers on Dec 28 2020, 11:37 PM.
Tags
None
Referenced Files
F102573097: D27804.id81425.diff
Thu, Nov 14, 5:51 AM
Unknown Object (File)
Tue, Nov 12, 2:59 PM
Unknown Object (File)
Sun, Oct 27, 6:50 AM
Unknown Object (File)
Oct 6 2024, 9:06 PM
Unknown Object (File)
Oct 5 2024, 9:54 AM
Unknown Object (File)
Oct 5 2024, 7:51 AM
Unknown Object (File)
Oct 4 2024, 8:13 PM
Unknown Object (File)
Oct 4 2024, 2:57 PM
Subscribers

Details

Summary

fusefs: update FUSE protocol to 7.24 and implement FUSE_LSEEK

FUSE_LSEEK reports holes on fuse file systems, and is used for example
by bsdtar.

MFC after: 2 weeks
Relnotes: yes

Test Plan

test cases added. Manual testing performed with tar, ktrace, and libfuse's passthrough file system

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/fs/fuse/fuse_ipc.h
281–282

Should we assert !notimpl?

sys/fs/fuse/fuse_vnops.c
330

style(9): extra blank line

342–345

Shouldn't any non-ENOSYS error path invoke fsess_set_impl(..., LSEEK)?

947

Is it safe to access *offp without copyin/copyout? For ordinary syscall arguments, I think it would not be. But maybe we copy in (and out) the a_data section of ioctl args?

1452–1453

style(9): brace goes on the end of the previous line

sys/kern/vfs_vnops.c
1645 ↗(On Diff #81281)

spurious added line? seems unreachable.

tests/sys/fs/fusefs/mockfs.cc
114

Could drop the constant and use nitems(). Not a big deal.

asomers added inline comments.
sys/fs/fuse/fuse_ipc.h
281–282

Maybe. But I worry that a schizophrenic server might change its mind about whether a particular RPC is supported and trigger a panic. That's not possible ATM, because fsess_set_impl is only called in one place, but it might be possible if we start using fsess_set_impl more widely.

sys/fs/fuse/fuse_vnops.c
342–345

No, because there are errors like ENOTCONN that can be returned even if the daemon never got the message.

947

Yes, it's safe. offp points to kernel space. See the fo_ioctl call about 75% of the way through vn_seek.

sys/kern/vfs_vnops.c
1645 ↗(On Diff #81281)

damn, yes that wasn't supposed to be submitted. You'd think the compiler would complain.

asomers marked 3 inline comments as done.
  • Respond to cem's comments, and fix a vnode locking inconsistency

Thanks!

sys/fs/fuse/fuse_ipc.h
281–282

Makes sense to me, thanks.

sys/fs/fuse/fuse_vnops.c
342–345

If the list of errors is known, we could still set impl in many more cases? Not a big deal I guess.

This revision is now accepted and ready to land.Dec 30 2020, 2:54 PM