Skip to content

WasmFS: Allow backends to implement readv to support pipes #16269

Open
@tlively

Description

@tlively

Right now WasmFS implements readv by issuing multiple individual reads to a backend, so there's no way for the backend to tell the difference between a single large read using multiple iovecs and multiple smaller reads each using one iovec. This makes it impossible to correctly implement pipes.

Pipe semantics are that reads return immediately when data is available even if the read requests more data than is available, but reads block when there is no data available. If an overlarge read that should not block is split over multiple iovecs, one of the multiple backend reads might precisely empty the pipe and the next backend read call will incorrectly block because the backend will think that it is a new read call on an empty pipe rather than a continuation of the same read call.

The fix is to give backends visibility into full readv calls, not just individual single-buffer reads.

We should also look into whether there is an analogous problem for writes.

Metadata

Metadata

Labels

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions