]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: require --yes-i-really-mean-it to run radosgw-admin orphans find 22986/head
authorMatt Benjamin <mbenjamin@redhat.com>
Wed, 16 May 2018 17:04:55 +0000 (13:04 -0400)
committerJos Collin <jcollin@redhat.com>
Wed, 11 Jul 2018 08:29:38 +0000 (13:59 +0530)
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>
(cherry picked from commit 3ff47c7f3eb5964464c8cd49144546ce532ed7f7)

src/rgw/rgw_admin.cc

index e3611f80988b00dd86ddc5b55050df60909742b7..d8ff336ec63471b187175ec58f9ac0a40ef4547c 100644 (file)
@@ -6418,6 +6418,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()) {