From: Venky Shankar Date: Mon, 23 Jul 2018 06:30:47 +0000 (-0400) Subject: cephfs-journal-tool: pass local arg vector for Journal actions X-Git-Tag: v12.2.11~96^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7cf2e1b623dc88aa0aba24bbb1e5ef5cd49ab3fc;p=ceph.git cephfs-journal-tool: pass local arg vector for Journal actions 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 (cherry picked from commit d5e482a6c2782993e6e9903eb6f11f5ebe260925) --- diff --git a/src/tools/cephfs/JournalTool.cc b/src/tools/cephfs/JournalTool.cc index 291ba7755537..a5f927431c47 100644 --- a/src/tools/cephfs/JournalTool.cc +++ b/src/tools/cephfs/JournalTool.cc @@ -147,13 +147,14 @@ int JournalTool::main(std::vector &argv) // ========= for (auto role : role_selector.get_roles()) { rank = role.rank; + std::vector 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();