]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Compare all object info even when can't consider for auth copy
authorDavid Zafman <dzafman@redhat.com>
Thu, 13 Jul 2017 16:45:21 +0000 (09:45 -0700)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 23 Aug 2017 13:44:27 +0000 (15:44 +0200)
Signed-off-by: David Zafman <dzafman@redhat.com>
(cherry picked from commit 437e5cf1067658912fe15859d18615c733c84f1a)

src/osd/PGBackend.cc

index a8f2aa66479ef021875e0d2b77ae5a50999bc153..312e9a7a44c1e32bc28805b8b827cebc9a608d50 100644 (file)
@@ -758,7 +758,7 @@ map<pg_shard_t, ScrubMap *>::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<pg_shard_t, ScrubMap *>::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<pg_shard_t, ScrubMap *>::const_iterator
       auth = j;
       *auth_oi = oi;
       auth_version = oi.version;
-      auth_bl.clear();
-      auth_bl.append(bl);
     }
 
 out: