Browse Source

Fix crash while reading metadata

blocking-uring-test
Vitaliy Filippov 3 years ago
parent
commit
a6770f619a
  1. 5
      blockstore_init.cpp

5
blockstore_init.cpp

@ -80,15 +80,14 @@ int blockstore_init_meta::loop()
void blockstore_init_meta::handle_entries(struct clean_disk_entry* entries, int count, int block_order)
{
auto end = bs->clean_db.end();
for (unsigned i = 0; i < count; i++)
{
if (entries[i].oid.inode > 0)
{
auto clean_it = bs->clean_db.find(entries[i].oid);
if (clean_it == end || clean_it->second.version < entries[i].version)
if (clean_it == bs->clean_db.end() || clean_it->second.version < entries[i].version)
{
if (clean_it != end)
if (clean_it != bs->clean_db.end())
{
// free the previous block
allocator_set(bs->data_alloc, clean_it->second.version >> block_order, false);

Loading…
Cancel
Save