diff options
Diffstat (limited to 'src/tools/rados/rados.cc')
-rw-r--r-- | src/tools/rados/rados.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/tools/rados/rados.cc b/src/tools/rados/rados.cc index 3d602e749..f2afe768c 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; } @@ -3120,7 +3120,12 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts, cerr << "WARNING: pool copy does not preserve user_version, which some " << "apps may rely on." << std::endl; - if (rados.get_pool_is_selfmanaged_snaps_mode(src_pool)) { + ret = rados.pool_is_in_selfmanaged_snaps_mode(src_pool); + if (ret < 0) { + cerr << "failed to query pool " << src_pool << " for selfmanaged snaps: " + << cpp_strerror(ret) << std::endl; + return 1; + } else if (ret > 0) { cerr << "WARNING: pool " << src_pool << " has selfmanaged snaps, which are not preserved\n" << " by the cppool operation. This will break any snapshot user." << std::endl; @@ -3128,7 +3133,7 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts, cerr << " If you insist on making a broken copy, you can pass\n" << " --yes-i-really-mean-it to proceed anyway." << std::endl; - exit(1); + return 1; } } @@ -3213,7 +3218,12 @@ static int rados_tool_common(const std::map < std::string, std::string > &opts, return 1; } - if (rados.get_pool_is_selfmanaged_snaps_mode(pool_name)) { + ret = rados.pool_is_in_selfmanaged_snaps_mode(pool_name); + if (ret < 0) { + cerr << "failed to query pool " << pool_name << " for selfmanaged snaps: " + << cpp_strerror(ret) << std::endl; + return 1; + } else if (ret > 0) { cerr << "can't create snapshot: pool " << pool_name << " is in selfmanaged snaps mode" << std::endl; return 1; |