shithub: gefs

Download patch

ref: 0976218b5053b413e631c794b6d4b1918ad4dd78
parent: 6c19bab8acf28d0d70c262ababdc7215850e5c36
author: Ori Bernstein <ori@eigenstate.org>
date: Mon Jan 31 21:21:34 EST 2022

blk: fix allocator ordering issues (thanks mcf)

logappend inserts LogAlloc1 in case it needed to
allocate a new log block.

However, these new log blocks are allocated from
the root of the avl tree, and compresslog traverses
starting from avlmin; the current code inserts into
the current log segment, instead of the active one,
which means that logappend could insert a LogAlloc1
for the new log block before the freeing of the block
would be allocated.

Additionally, we chain the wrong block when compressing
the allocation log.

This fixes both issues.