]> git.apps.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>
Mon, 3 Dec 2018 07:39:49 +0000 (02:39 -0500)
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>
(cherry picked from commit d5e482a6c2782993e6e9903eb6f11f5ebe260925)

src/tools/cephfs/JournalTool.cc

index 291ba775553788b1d6b173c14b047f7c60246e22..a5f927431c477ca84fef24ada0e14c486f76bb94 100644 (file)
@@ -147,13 +147,14 @@ int JournalTool::main(std::vector<const char*> &argv)
   // =========
   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 {
       derr << "Bad command '" << mode << "'" << dendl;
       usage();