summaryrefslogtreecommitdiffstats
path: root/src/tools/rbd
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2021-05-26 14:21:22 +0200
committerIlya Dryomov <idryomov@gmail.com>2021-05-31 11:44:47 +0200
commit0bcb9102174e5d1279fbc507acb161160a366dff (patch)
tree2f053f2cdbe885afda6fa2987205ef1ca7599cf2 /src/tools/rbd
parentrbd: propagate Trash::purge() result (diff)
downloadceph-0bcb9102174e5d1279fbc507acb161160a366dff.tar.xz
ceph-0bcb9102174e5d1279fbc507acb161160a366dff.zip
rbd: combined error message for expected Trash::purge() errors
Output to stderr instead of the log where regular users wouldn't see it given the elevated log level. Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'src/tools/rbd')
-rw-r--r--src/tools/rbd/action/Trash.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/tools/rbd/action/Trash.cc b/src/tools/rbd/action/Trash.cc
index ba09c6406df..05cc724589b 100644
--- a/src/tools/rbd/action/Trash.cc
+++ b/src/tools/rbd/action/Trash.cc
@@ -446,6 +446,15 @@ int execute_purge(const po::variables_map &vm,
r = rbd.trash_purge_with_progress(io_ctx, expire_ts, threshold, pc);
if (r < 0) {
pc.fail();
+ if (r == -ENOTEMPTY || r == -EBUSY || r == -EMLINK || r == -EUCLEAN) {
+ std::cerr << "rbd: some expired images could not be removed"
+ << std::endl
+ << "Ensure that they are closed/unmapped, do not have "
+ << "snapshots (including trashed snapshots with linked "
+ << "clones), are not in a group and were moved to the "
+ << "trash successfully."
+ << std::endl;
+ }
return r;
}