]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: be precise about "known" vs "best guess"
authorSage Weil <sage@redhat.com>
Thu, 26 Mar 2015 20:44:25 +0000 (13:44 -0700)
committerSage Weil <sage@redhat.com>
Tue, 7 Apr 2015 18:42:14 +0000 (11:42 -0700)
We cannot assume that the auth info has the "known" digest; all replicas
may have a matching digest that does not match the oi, or we may choose
a different auth info for some other reason.  Verify that the digest
matches the oi before calling it "known".

Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PGBackend.cc

index 535b2a6c878bf5b803cc6eaf15afaabb925aa051..ada84a6d3d0fd9f61eacb6484b0e08d9594e9b78 100644 (file)
@@ -390,9 +390,11 @@ enum scrub_error_type PGBackend::be_compare_scrub_objects(
       if (error != CLEAN)
         errorstream << ", ";
       error = DEEP_ERROR;
+      bool known = okseed && auth_oi.is_data_digest() &&
+       auth.digest == auth_oi.data_digest;
       errorstream << "data_digest 0x" << std::hex << candidate.digest
                  << " != "
-                 << (auth_oi.is_data_digest() && okseed ? "known" : "best guess")
+                 << (known ? "known" : "best guess")
                  << " data_digest 0x" << auth.digest << std::dec
                  << " from auth shard " << auth_shard;
     }
@@ -402,9 +404,11 @@ enum scrub_error_type PGBackend::be_compare_scrub_objects(
       if (error != CLEAN)
         errorstream << ", ";
       error = DEEP_ERROR;
+      bool known = okseed && auth_oi.is_omap_digest() &&
+       auth.digest == auth_oi.omap_digest;
       errorstream << "omap_digest 0x" << std::hex << candidate.omap_digest
                  << " != "
-                 << (auth_oi.is_omap_digest() && okseed ? "known" : "best guess")
+                 << (known ? "known" : "best guess")
                  << " omap_digest 0x" << auth.omap_digest << std::dec
                  << " from auth shard " << auth_shard;
     }