mirror of
https://github.com/ceph/ceph
synced 2024-12-18 01:16:55 +00:00
Objecter::calc_target(): init best_locality with 0
Init best_locality to fix: osdc/Objecter.cc:1519:26: warning: variable 'best_locality' may be uninitialized when used here [-Wconditional-uninitialized] (locality >= 0 && best_locality >= 0 && ^~~~~~~~~~~~~ osdc/Objecter.cc:1511:19: note: initialize the variable 'best_locality' to silence this warning int best_locality; ^ = 0 Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
This commit is contained in:
parent
b4b79ebbec
commit
8322878c22
@ -1508,7 +1508,7 @@ int Objecter::calc_target(op_target_t *t)
|
||||
// look for a local replica. prefer the primary if the
|
||||
// distance is the same.
|
||||
int best = -1;
|
||||
int best_locality;
|
||||
int best_locality = 0;
|
||||
for (unsigned i = 0; i < acting.size(); ++i) {
|
||||
int locality = osdmap->crush->get_common_ancestor_distance(
|
||||
cct, acting[i], crush_location);
|
||||
|
Loading…
Reference in New Issue
Block a user