Fix single active logblock allocation for logregion-only case

Should be irrelevant in practice, because we would not flush
a single block during startup.
parent de0ed184
......@@ -2412,15 +2412,21 @@ logbuffer_flush(struct fellow_fd *ffd,
if (! cap(can, LBUF_CAN_REF))
return;
logbuffer_need_ioctx(ffd, lbuf);
// the active block is the head block
AZ(lbuf->n);
CHECK_BLK_SEQ(lbuf->active.block, lbuf->flush_seq);
if (lbuf->active.off == 0)
if (lbuf->active.off == 0 && cap(can, LBUF_CAN_FLUSH))
logbuffer_alloc_some(lbuf, &lbuf->active, 1);
if (lbuf->active.off == 0 &&
logblocks_alloc_from_logregion(lbuf->logreg,
&lbuf->active, 1) != 1) {
lbuf->state = LBUF_MEM;
return;
}
logbuffer_need_ioctx(ffd, lbuf);
while (! flush_active(ffd, lbuf, doclose ? FAIO_CLOSE : 0))
(void) fellow_io_log_wait_completions(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment