HomeFreeBSD

makefs: Implement the collision differentiator for micro ZAPs

Description

makefs: Implement the collision differentiator for micro ZAPs

In the unlikely event of a hash collision, the collision differentiator
is used to create a unique lookup key for ZAP entries. While the fat
ZAP implementation in makefs implemented this, the micro ZAP
implementation did not, so it's possible to end up with collisions in
directory entries. These are caught deterministically by OpenZFS, but
the result is a panic.

Implement a simple differentiator by simply assigning a unique value to
each ZAP entry. This scheme works since the 16-bit space of
differentiators is larger than the maximum number of entries in a micro
ZAP. (While the on-disk encoding provides 32 bits of space for the
differentiator, the in-memory representation of micro ZAP entries is
smaller.)

PR: 287482
MFC after: 1 week

Details

Provenance
markjAuthored on Jun 16 2025, 8:33 PM
Parents
rGc13f4b1574da: tcp: cleanup timer initialisations
Branches
Unknown
Tags
Unknown