HomeFreeBSD

Correct the condition under which we allocate a terminator node.

Description

Correct the condition under which we allocate a terminator node.

We will have last_block < blocks if the block count is divisible
by BLIST_BMAP_RADIX, but a terminator node is still needed if the
tree isn't balanced. In this case we were overruning the blist
array by 16 bytes during initialization.

While here, add a check for the invalid blocks == 0 case.

PR: 231116
Reviewed by: alc, kib (previous version), Doug Moore <dougm@rice.edu>
Approved by: re (gjb)
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17020

Details

Provenance
markjAuthored on
Reviewer
alc
Differential Revision
D17020: Fix an edge case in the node count computation in blist_create().
Parents
rS338471: Move gettytab to libexec/getty/
Branches
Unknown
Tags
Unknown