summaryrefslogtreecommitdiffstats
path: root/src/osd/PGBackend.cc
diff options
context:
space:
mode:
authorSage Weil <sage@redhat.com>2014-12-10 01:28:52 +0100
committerSage Weil <sage@redhat.com>2014-12-20 16:30:01 +0100
commitcf3b04764d118db09bb9a7511016070f5d85f042 (patch)
treef4fd26df15a24e3d40d8b401546aa1810b79aaaa /src/osd/PGBackend.cc
parentosd: move scrub no good auth check out of helper (diff)
downloadceph-cf3b04764d118db09bb9a7511016070f5d85f042.tar.xz
ceph-cf3b04764d118db09bb9a7511016070f5d85f042.zip
osd: scrub: share auth oi with caller and be_compare_scrub_objects
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/osd/PGBackend.cc')
-rw-r--r--src/osd/PGBackend.cc18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc
index 4491b3eb434..d931c79d35b 100644
--- a/src/osd/PGBackend.cc
+++ b/src/osd/PGBackend.cc
@@ -371,7 +371,9 @@ void PGBackend::be_scan_list(
}
enum scrub_error_type PGBackend::be_compare_scrub_objects(
+ pg_shard_t auth_shard,
const ScrubMap::object &auth,
+ const object_info_t& auth_oi,
const ScrubMap::object &candidate,
ostream &errorstream)
{
@@ -442,7 +444,8 @@ enum scrub_error_type PGBackend::be_compare_scrub_objects(
map<pg_shard_t, ScrubMap *>::const_iterator
PGBackend::be_select_auth_object(
const hobject_t &obj,
- const map<pg_shard_t,ScrubMap*> &maps)
+ const map<pg_shard_t,ScrubMap*> &maps,
+ object_info_t *auth_oi)
{
map<pg_shard_t, ScrubMap *>::const_iterator auth = maps.end();
for (map<pg_shard_t, ScrubMap *>::const_iterator j = maps.begin();
@@ -498,6 +501,7 @@ map<pg_shard_t, ScrubMap *>::const_iterator
dout(10) << __func__ << ": selecting osd " << j->first
<< " for obj " << obj
<< dendl;
+ *auth_oi = oi;
auth = j;
}
return auth;
@@ -528,8 +532,9 @@ void PGBackend::be_compare_scrubmaps(
for (set<hobject_t>::const_iterator k = master_set.begin();
k != master_set.end();
++k) {
+ object_info_t auth_oi;
map<pg_shard_t, ScrubMap *>::const_iterator auth =
- be_select_auth_object(*k, maps);
+ be_select_auth_object(*k, maps, &auth_oi);
if (auth == maps.end()) {
// Something is better than nothing
// TODO: something is NOT better than nothing, do something like
@@ -551,9 +556,12 @@ void PGBackend::be_compare_scrubmaps(
if (j->second->objects.count(*k)) {
// Compare
stringstream ss;
- enum scrub_error_type error = be_compare_scrub_objects(auth->second->objects[*k],
- j->second->objects[*k],
- ss);
+ enum scrub_error_type error =
+ be_compare_scrub_objects(auth->first,
+ auth->second->objects[*k],
+ auth_oi,
+ j->second->objects[*k],
+ ss);
if (error != CLEAN) {
cur_inconsistent.insert(j->first);
if (error == SHALLOW_ERROR)