From: Sage Weil Date: Fri, 27 Mar 2015 17:17:12 +0000 (-0700) Subject: osd: include newlines in scrub errors X-Git-Tag: v0.94.4~79^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4faa8e04069417a6e2a6c4ea5c10b54d76aa00c4;p=ceph.git 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) --- diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 95b177f2fd68..7fc56d10fa49 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; }