Limit pg_size by 64

This commit is contained in:
Vitaliy Filippov
2026-06-18 00:24:48 +03:00
parent ec9cfa76c1
commit 5627977a9b
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -416,7 +416,8 @@ void etcd_state_client_t::parse_state(const etcd_kv_t & kv)
if (pc.pg_size < 1 ||
pool_item.second["pg_size"].uint64_value() < 3 &&
(pc.scheme == POOL_SCHEME_XOR || pc.scheme == POOL_SCHEME_EC) ||
pool_item.second["pg_size"].uint64_value() > 256)
// limit is 64 because osd_peering_pg.cpp uses a 64-bit mask for has_roles
pool_item.second["pg_size"].uint64_value() > 64)
{
fprintf(stderr, "Pool %u has invalid pg_size, skipping pool\n", pool_id);
continue;
+2 -2
View File
@@ -159,9 +159,9 @@ void pg_obj_state_check_t::handle_version()
{
n_mismatched++;
}
if (!(has_roles & (1 << replica)))
if (!(has_roles & ((uint64_t)1 << replica)))
{
has_roles = has_roles | (1 << replica);
has_roles = has_roles | ((uint64_t)1 << replica);
n_roles++;
}
}