From: David Zafman Date: Thu, 16 Feb 2017 00:17:32 +0000 (-0800) Subject: ceph-osdomap-tool: Fix seg fault with large amount of check error output X-Git-Tag: v10.2.8~52^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6902c3141eeaefaacd92f33877cf319872f626c7;p=ceph.git ceph-osdomap-tool: Fix seg fault with large amount of check error output Signed-off-by: David Zafman (cherry picked from commit 1dda0411f4fbb14ce1e0062da9f14ec3af505d39) --- diff --git a/src/tools/ceph_osdomap_tool.cc b/src/tools/ceph_osdomap_tool.cc index 11d984e33052..57cc3ecc0192 100644 --- a/src/tools/ceph_osdomap_tool.cc +++ b/src/tools/ceph_osdomap_tool.cc @@ -161,9 +161,11 @@ int main(int argc, char **argv) { } } } else if (cmd == "check" || cmd == "repair") { + ostringstream ss; bool repair = (cmd == "repair"); - r = omap.check(std::cout, repair); + r = omap.check(ss, repair); if (r > 0) { + std::cerr << ss.str() << std::endl; std::cerr << "check got " << r << " error(s)" << std::endl; r = 1; goto done;