fellow_log: logwatcher flush is also needed when dsk needs to be freed

the periodic flush via FLW_MAYFLUSH (which writes a new header) also needs to be
active when there are disk blocks to be freed, otherwise we might deadlock.
parent c6016408
......@@ -6145,6 +6145,10 @@ fellow_logwatcher_need(struct fellow_fd *ffd, struct flw_need_why *why)
return (need);
}
if (lbuf->regions_to_free != NULL &&
regionlist_used(lbuf->regions_to_free) > 0)
return (FLW_MAYFLUSH);
if (lbuf->space == 0 || lbuf->n == 0)
return (FLW_NEED_NONE);
......@@ -6168,7 +6172,11 @@ fellow_logwatcher_flush(struct fellow_fd *ffd, unsigned can)
{
DBG("concurrent n=%u state=%u", ffd->logbuf->n, ffd->logbuf->state);
if (ffd->logbuf->n == 0 || ffd->logbuf->state != LBUF_OPEN)
if (ffd->logbuf->state != LBUF_OPEN)
return;
if ((ffd->logbuf->regions_to_free == NULL ||
regionlist_used(ffd->logbuf->regions_to_free) == 0) &&
ffd->logbuf->n == 0)
return;
// logmtx is held
......
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