]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Correct the condition under which we allocate a terminator node.
authorMark Johnston <markj@FreeBSD.org>
Wed, 5 Sep 2018 19:05:30 +0000 (19:05 +0000)
committerMark Johnston <markj@FreeBSD.org>
Wed, 5 Sep 2018 19:05:30 +0000 (19:05 +0000)
commitce9eea64253d9f9be95a37cfe36e89bbb2dfa85a
tree7f115d7711d933615613fa1a5c5614728ef090a2
parentce9e223ebd9c3fc9225b1d45d598fe2988f64dde
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
sys/kern/subr_blist.c