v0.4.0
Drops the experimental notice from the NFS package and adds opt-in read delegations, which let a client serve repeated reads from its own cache without asking the server at all.
The nfs4 package is no longer experimental
The two acceptance criteria that were still open now pass against real clients:
- A client that loses its connection with work in flight. The Linux smoke test mounts through a proxy, starts a workload of writes and byte-range locks, and cuts every connection part way through. The client reconnects, retransmits, and every operation lands exactly once: 300 files, each with the content it was written with, none duplicated.
- Two hosts contending for byte-range locks. Two containers are two NFSv4 clients. A lock held on one host is refused to the other, and when the holder dies without unlocking — killed, no unmount — lease expiry frees its lock and the waiting host acquires it.
The trust model is unchanged and stays documented: AUTH_SYS identities on a trusted network, volatile state across restarts, advisory locks.
New: read delegations, off by default
A kernel NFS server hands out read delegations freely, so a client re-reading a file it already holds sends no requests. Until now this server answered every one. Measured against a real Linux client reading the same file again:
| RPCs for the re-read | |
|---|---|
| Without a delegation | 2 |
| With a delegation | 0 |
nfs4.Server{ReadDelegations: true} enables them. The server probes the client's callback path with CB_NULL when the client is confirmed, grants a delegation on a read-only open when the path answered and no other client could make the promise false, and recalls it with CB_RECALL before any conflicting operation proceeds — a write open, a write, a size or time change, a remove, a rename, a link. A client that does not return a recalled delegation within the lease loses it, and its later use of the stateid is answered with NFS4ERR_ADMIN_REVOKED.
A firewalled or NAT-ed callback path — the common case — costs nothing: the probe runs off the request path, the client is served normally, and it simply never receives a delegation.
Why off by default: a delegation is a promise that the file will not change without the client hearing first, and this server can only recall what it sees. A write through WebDAV or SFTP, or by the application itself, recalls nothing, and a delegated client would keep serving stale data. Enable delegations only when the NFS server is the only writer.
Also
examples/nfsgrew-delegationsand-leaseflags.- New real-client scripts:
scripts/nfs-deleg-linux.shmeasures what a delegation saves;scripts/nfs-two-clients-linux.shruns the two-host lock contention and lease-expiry case. - New fuzz targets cover the two decoders this release added: the callback universal-address parser and callback replies, which now arrive from outside.