From: NitzanMordhai Date: Thu, 16 Nov 2023 07:09:29 +0000 (+0000) Subject: Tools/rados: Improve Error Messaging for Object Name Resolution X-Git-Tag: v19.1.0~603^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=313bfca056ef7f83c0e8c70a3bc4ff9d070b63d9;p=ceph.git Tools/rados: Improve Error Messaging for Object Name Resolution The current implementation of 'rados clearomap' exhibits a behavior where an error message is generated without the associated object name or, in the case of a non-existent object name, may result in a segmentation fault. The proposed fix addresses this issue by enhancing the error message. After applying the fix, error messages will consistently display the correct object name, providing users with more accurate and actionable information. Fixes: https://tracker.ceph.com/issues/63541 Signed-off-by: Nitzan Mordechai --- diff --git a/src/tools/rados/rados.cc b/src/tools/rados/rados.cc index 3d602e749cdee..cd301916c478f 100644 --- a/src/tools/rados/rados.cc +++ b/src/tools/rados/rados.cc @@ -2971,7 +2971,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts, for (const auto& oid : oids) { ret = io_ctx.omap_clear(oid); if (ret < 0) { - cerr << "error clearing omap keys " << pool_name << "/" << prettify(*obj_name) << "/" + cerr << "error clearing omap keys " << pool_name << "/" << prettify(oid) << "/" << cpp_strerror(ret) << std::endl; return 1; }