Fix op validation, fix journal sector usage tracking

Now it runs for a while with fio but then crashes with ENOSPC because
of an apparent bug in the allocator
This commit is contained in:
Vitaliy Filippov
2019-11-26 20:38:25 +03:00
parent a6770f619a
commit b8e53f8c67
5 changed files with 76 additions and 35 deletions
+5 -1
View File
@@ -173,9 +173,13 @@ void blockstore::handle_write_event(ring_data_t *data, blockstore_operation *op)
// Release used journal sectors
if (op->min_used_journal_sector > 0)
{
for (uint64_t s = op->min_used_journal_sector; s <= op->max_used_journal_sector; s++)
uint64_t s = op->min_used_journal_sector;
while (1)
{
journal.sector_info[s-1].usage_count--;
if (s == op->max_used_journal_sector)
break;
s = (s + 1) % journal.sector_count;
}
op->min_used_journal_sector = op->max_used_journal_sector = 0;
}