From 4ee6292f9297b60bab5405419ea72fc42739733b Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 13 Jul 2017 09:45:21 -0700 Subject: [PATCH] osd: Compare all object info even when can't consider for auth copy Signed-off-by: David Zafman (cherry picked from commit 437e5cf1067658912fe15859d18615c733c84f1a) --- src/osd/PGBackend.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index a8f2aa66479..312e9a7a44c 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -758,7 +758,7 @@ map::const_iterator inconsistent_obj_wrapper &object_error) { eversion_t auth_version; - bufferlist auth_bl; + bufferlist first_bl; // Create list of shards with primary last so it will be auth copy all // other things being equal. @@ -832,11 +832,11 @@ map::const_iterator // This is automatically corrected in PG::_repair_oinfo_oid() assert(oi.soid == obj); - if (auth_version != eversion_t()) { - if (!object_error.has_object_info_inconsistency() && !(bl == auth_bl)) { - object_error.set_object_info_inconsistency(); - error_string += " object_info_inconsistency"; - } + if (first_bl.length() == 0) { + first_bl.append(bl); + } else if (!object_error.has_object_info_inconsistency() && !bl.contents_equal(first_bl)) { + object_error.set_object_info_inconsistency(); + error_string += " object_info_inconsistency"; } // Don't use this particular shard because it won't be able to repair data @@ -866,8 +866,6 @@ map::const_iterator auth = j; *auth_oi = oi; auth_version = oi.version; - auth_bl.clear(); - auth_bl.append(bl); } out: -- 2.47.3