From f2002b7fa2af2db52037da4c1cf66d405a4941e7 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 26 Mar 2015 13:44:25 -0700 Subject: [PATCH] osd: be precise about "known" vs "best guess" 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 (cherry picked from commit 546d1c7b8224d96d0cc93dc3c96f52787cd69413) --- src/osd/PGBackend.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 535b2a6c878b..ada84a6d3d0f 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -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; } -- 2.47.3