Replace pgs[id] with pgs.at(id) to prevent accidental auto-vivification

This commit is contained in:
Vitaliy Filippov
2021-02-28 19:36:59 +03:00
parent 7d49706c07
commit 6155b23a7e
4 changed files with 11 additions and 8 deletions
+4 -1
View File
@@ -593,7 +593,10 @@ void osd_t::apply_pg_config()
}
else
{
throw std::runtime_error("Unexpected PG "+std::to_string(pg_num)+" state: "+std::to_string(pg_it->second.state));
throw std::runtime_error(
"Unexpected PG "+std::to_string(pool_id)+"/"+std::to_string(pg_num)+
" state: "+std::to_string(pg_it->second.state)
);
}
}
auto & pg = this->pgs[{ .pool_id = pool_id, .pg_num = pg_num }];