From 4faa8e04069417a6e2a6c4ea5c10b54d76aa00c4 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 27 Mar 2015 10:17:12 -0700 Subject: [PATCH] osd: include newlines in scrub errors We may log more than one of these in a scrubmap; make sure they are not concatenated. Signed-off-by: Sage Weil (cherry picked from commit 2b3dd1bb7ab360e8f467a47b7ce3a0e4d3a979b2) --- src/osd/PGBackend.cc | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 95b177f2fd680..7fc56d10fa490 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -579,8 +579,8 @@ void PGBackend::be_compare_scrubmaps( if (auth == maps.end()) { dout(10) << __func__ << ": unable to find any auth object" << dendl; ++shallow_errors; - errorstream << __func__ << ": " << pgid << " shard " << j->first - << ": soid failed to pick suitable auth object"; + errorstream << pgid << " shard " << j->first + << ": soid failed to pick suitable auth object\n"; continue; } auth_list.push_back(auth->first); @@ -609,8 +609,8 @@ void PGBackend::be_compare_scrubmaps( ++shallow_errors; else ++deep_errors; - errorstream << __func__ << ": " << pgid << " shard " << j->first - << ": soid " << *k << " " << ss.str(); + errorstream << pgid << " shard " << j->first << ": soid " << *k + << " " << ss.str() << "\n"; } else { auth_list.push_back(j->first); } @@ -618,8 +618,8 @@ void PGBackend::be_compare_scrubmaps( clean = false; cur_missing.insert(j->first); ++shallow_errors; - errorstream << __func__ << ": " << pgid << " shard " << j->first - << " missing " << *k; + errorstream << pgid << " shard " << j->first << " missing " << *k + << "\n"; } } if (!cur_missing.empty()) { @@ -645,18 +645,20 @@ void PGBackend::be_compare_scrubmaps( if (auth_oi.is_data_digest() && auth_object.digest_present && auth_oi.data_digest != auth_object.digest) { ++deep_errors; - errorstream << __func__ << ": " << pgid << " recorded data digest 0x" + errorstream << pgid << " recorded data digest 0x" << std::hex << auth_oi.data_digest << " != on disk 0x" - << auth_object.digest << std::dec << " on " << auth_oi.soid; + << auth_object.digest << std::dec << " on " << auth_oi.soid + << "\n"; if (repair) update = FORCE; } if (auth_oi.is_omap_digest() && auth_object.omap_digest_present && auth_oi.omap_digest != auth_object.omap_digest) { ++deep_errors; - errorstream << __func__ << ": " << pgid << " recorded omap digest 0x" + errorstream << pgid << " recorded omap digest 0x" << std::hex << auth_oi.data_digest << " != on disk 0x" - << auth_object.digest << std::dec << " on " << auth_oi.soid; + << auth_object.digest << std::dec << " on " << auth_oi.soid + << "\n"; if (repair) update = FORCE; } -- 2.39.5