]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-journal-tool: pass local arg vector for Journal actions
authorVenky Shankar <vshankar@redhat.com>
Mon, 23 Jul 2018 06:30:47 +0000 (02:30 -0400)
committerVenky Shankar <vshankar@redhat.com>
Fri, 21 Sep 2018 10:09:39 +0000 (06:09 -0400)
Some helper functions clobber the passed in arg vector. This
causes operations on all but the first rank to fail as the
operations for the first rank tampers with the arg vector.

Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/tools/cephfs/JournalTool.cc

index 0ad770a95eb28611f182a825db159fbf1e557458..8be2cd85034ff4b850d7498e9d18615f9eec7abe 100644 (file)
@@ -163,13 +163,14 @@ int JournalTool::main(std::vector<const char*> &argv)
   // event mode is only specific for mdlog
   for (auto role : role_selector.get_roles()) {
     rank = role.rank;
+    std::vector<const char *> rank_argv(argv);
     dout(4) << "Executing for rank " << rank << dendl;
     if (mode == std::string("journal")) {
-      r = main_journal(argv);
+      r = main_journal(rank_argv);
     } else if (mode == std::string("header")) {
-      r = main_header(argv);
+      r = main_header(rank_argv);
     } else if (mode == std::string("event")) {
-      r = main_event(argv);
+      r = main_event(rank_argv);
     } else {
       cerr << "Bad command '" << mode << "'" << std::endl;
       return -EINVAL;