Commit 1e3cfe58 authored by Nils Goroll's avatar Nils Goroll Committed by Reza Naghibi

directors.shard: fix hole handling during recondiguration

parent f0065411
......@@ -353,10 +353,15 @@ shardcfg_backend_lookup(const struct backend_reconfig *re,
unsigned i, max = re->shardd->n_backend + re->hole_n;
const struct shard_backend *bb = re->shardd->backend;
for (i = 0; i < max; i++)
if (max > 0)
AN(bb);
for (i = 0; i < max; i++) {
if (bb[i].backend == NULL)
continue; // hole
if (!shardcfg_backend_cmp(b, &bb[i]))
return &bb[i];
}
return NULL;
}
......@@ -432,6 +437,8 @@ shardcfg_backend_del(struct backend_reconfig *re,
struct shard_backend * const bb = re->shardd->backend;
for (i = 0; i < max; i++) {
if (bb[i].backend == NULL)
continue; // hole
if (shardcfg_backend_del_cmp(spec, &bb[i]))
continue;
......
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