From 74bd8708dfbfd3c8e7ba3f41d8534609dcbc1237 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Dec 2014 16:27:50 -0800 Subject: [PATCH] osd: move scrub no good auth check out of helper This helps call out that this is an exceptional case and simplifies the helper a bit. Signed-off-by: Sage Weil --- src/osd/PGBackend.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 60cc40c9afb1..4491b3eb4341 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -453,17 +453,6 @@ map::const_iterator if (i == j->second->objects.end()) { continue; } - if (auth == maps.end()) { - // Something is better than nothing - // TODO: something is NOT better than nothing, do something like - // unfound_lost if no valid copies can be found, or just mark unfound - auth = j; - dout(10) << __func__ << ": selecting osd " << j->first - << " for obj " << obj - << ", auth == maps.end()" - << dendl; - continue; - } if (i->second.read_error) { // scrub encountered read error, probably corrupt dout(10) << __func__ << ": rejecting osd " << j->first @@ -541,6 +530,18 @@ void PGBackend::be_compare_scrubmaps( ++k) { map::const_iterator auth = be_select_auth_object(*k, maps); + if (auth == maps.end()) { + // Something is better than nothing + // TODO: something is NOT better than nothing, do something like + // unfound_lost if no valid copies can be found, or just mark unfound + auth = j; + dout(10) << __func__ << ": selecting osd " << j->first + << " for obj " << *k + << ", something is better than nothing, FIXME" + << dendl; + continue; + } + assert(auth != maps.end()); set cur_missing; set cur_inconsistent; -- 2.47.3