HomeFreeBSD

fusefs: fix exporting fuse filesystems with nfsd

Description

fusefs: fix exporting fuse filesystems with nfsd

A previous commit made fuse exportable via userland NFS servers.
Compatibility with the in-kernel nfsd required two more changes:

  • During read and write operations, implicitly do a FUSE_OPEN if there isn't already a valid file handle. That's because nfsd never calls VOP_OPEN.
  • During VOP_READDIR, if an implicit open was necessary, directory offsets from a previous VOP_READDIR may not be valid, so VOP_READDIR may have to start from the beginning and read until it encounters the requested offset.

I've done only limited testing over NFS, so there are probably still some
more bugs. Thanks to rmacklem for all of the readdir changes, which he had
made for his pnfs work.

Sponsored by: The FreeBSD Foundation

Details

Provenance
asomersAuthored on
Parents
rS348208: fusefs: assume the mountpoint's generation is 0
Branches
Unknown
Tags
Unknown