From: Sage Weil Date: Fri, 27 Mar 2015 17:03:22 +0000 (-0700) Subject: osd: fix fallback logic; move into be_select_auth_object X-Git-Tag: v9.0.2~189^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b597db59fedc9a96dbe4b37f03b819dcf8fdb1bb;p=ceph.git 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 --- 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; }