HomeFreeBSD

fusefs: correctly handle short reads

Description

fusefs: correctly handle short reads

A fuse server may return a short read for three reasons:

  • The file is opened with FOPEN_DIRECT_IO. In this case, the short read should be returned directly to userland. We already handled this case correctly.
  • The file was truncated server-side, and the read hit EOF. In this case, the kernel should update the file size. Fixed in the case of VOP_READ. Fixing this for VOP_GETPAGES is TODO.
  • The file is opened in writeback mode, there are dirty buffers past what the server thinks is the file's EOF, and the read hit what the server thinks is the file's EOF. In this case, the client is trying to read a hole, and should zero-fill it. We already handled this case, and I added a test for it.

Sponsored by: The FreeBSD Foundation

Details

Provenance
asomersAuthored on
Parents
rS349278: bhyve: Fix vtscsi maximum segment config
Branches
Unknown
Tags
Unknown