]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: require --yes-i-really-mean-it to run radosgw-admin orphans find 22036/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 16 May 2018 17:04:55 +0000 (13:04 -0400)
committerMatt Benjamin <mbenjamin@redhat.com>
Wed, 16 May 2018 17:04:55 +0000 (13:04 -0400)
Incorrect use of orphans find can lead to data loss. Warn users to be
extra cautious.

Fixes: http://tracker.ceph.com/issues/24146
Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_admin.cc

index f9bfc861d83133752f34eab284d4cb54e2ecd0b4..e27ae1055af39343309b67e38833ce4af0f1a274 100644 (file)
@@ -6362,6 +6362,13 @@ next:
   }
 
   if (opt_cmd == OPT_ORPHANS_FIND) {
+    if (!yes_i_really_mean_it) {
+      cerr << "accidental removal of active objects can not be reversed; "
+          << "do you really mean it? (requires --yes-i-really-mean-it)"
+          << std::endl;
+      return EINVAL;
+    }
+
     RGWOrphanSearch search(store, max_concurrent_ios, orphan_stale_secs);
 
     if (job_id.empty()) {