From b597db59fedc9a96dbe4b37f03b819dcf8fdb1bb Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 27 Mar 2015 10:03:22 -0700 Subject: [PATCH] osd: fix fallback logic; move into be_select_auth_object The fallback behavior was printing a promising message but then doing a 'continue' and not actually scrubbing the object. Instead, fall back to a less-bad auth inside be_select_auth_object. Signed-off-by: Sage Weil --- src/osd/PGBackend.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 0ba4c24c0856..95b177f2fd68 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -498,6 +498,12 @@ map::const_iterator // invalid object info, probably corrupt continue; } + + // note candidate in case we can't find anything better, because + // something is better than nothing. FIXME. + auth = j; + *auth_oi = oi; + uint64_t correct_size = be_get_ondisk_size(oi.size); if (correct_size != i->second.size) { // invalid size, probably corrupt @@ -528,12 +534,12 @@ map::const_iterator continue; } } - dout(10) << __func__ << ": selecting osd " << j->first - << " for obj " << obj - << dendl; - auth = j; - *auth_oi = oi; + break; } + dout(10) << __func__ << ": selecting osd " << auth->first + << " for obj " << obj + << " with oi " << *auth_oi + << dendl; return auth; } -- 2.47.3