]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/cephfs/JournalTool.cc
import 15.2.2 octopus source
[ceph.git] / ceph / src / tools / cephfs / JournalTool.cc
index 3a3816c7a8e9bb916181d929f340b01d5a397488..f6d7c4116354c960b84d111fb76d3e82124ffd79 100644 (file)
@@ -378,15 +378,23 @@ int JournalTool::main_event(std::vector<const char*> &argv)
   }
 
   std::vector<const char*>::iterator arg = argv.begin();
+  bool dry_run = false;
+
   std::string command = *(arg++);
   if (command != "get" && command != "splice" && command != "recover_dentries") {
     derr << "Unknown argument '" << command << "'" << dendl;
     return -EINVAL;
   }
 
-  if (command == "recover_dentries" && type != "mdlog") {
-    derr << "journaler for " << type << " can't do \"recover_dentries\"." << dendl;
-    return -EINVAL;
+  if (command == "recover_dentries") {
+    if (type != "mdlog") {
+      derr << "journaler for " << type << " can't do \"recover_dentries\"." << dendl;
+      return -EINVAL;
+    } else {
+      if (arg != argv.end() && ceph_argparse_flag(argv, arg, "--dry_run", (char*)NULL)) {
+        dry_run = true;
+      }
+    }
   }
 
   if (arg == argv.end()) {
@@ -450,11 +458,6 @@ int JournalTool::main_event(std::vector<const char*> &argv)
       return r;
     }
 
-    bool dry_run = false;
-    if (arg != argv.end() && ceph_argparse_flag(argv, arg, "--dry_run", (char*)NULL)) {
-      dry_run = true;
-    }
-
     /**
      * Iterate over log entries, attempting to scavenge from each one
      */