]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rbd: fsx needs to shut down the journal 9556/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 2 Jun 2016 14:41:18 +0000 (10:41 -0400)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Tue, 7 Jun 2016 13:57:13 +0000 (19:27 +0530)
Fixes: http://tracker.ceph.com/issues/16123
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit d10ffaafbd2a5831154757b848ed8504dad99069)

src/test/librbd/fsx.cc

index f0519ec7d62ee1031306ccc2552be864e580439d..2a06b345e6d464f24ef4f451ad18d68672a019d8 100644 (file)
@@ -54,6 +54,8 @@
 #include "journal/ReplayEntry.h"
 #include "journal/ReplayHandler.h"
 
+#include <boost/scope_exit.hpp>
+
 #define NUMPRINTCOLUMNS 32     /* # columns of data to print on each line */
 
 /*
@@ -394,6 +396,10 @@ int replay_journal(rados_ioctx_t ioctx, const char *image_name,
         journal::Journaler journaler(io_ctx, image_id, JOURNAL_CLIENT_ID, 0);
         C_SaferCond init_ctx;
         journaler.init(&init_ctx);
+        BOOST_SCOPE_EXIT_ALL( (&journaler) ) {
+                journaler.shut_down();
+        };
+
         r = init_ctx.wait();
         if (r < 0) {
                 simple_err("failed to initialize journal", r);
@@ -401,8 +407,13 @@ int replay_journal(rados_ioctx_t ioctx, const char *image_name,
         }
 
         journal::Journaler replay_journaler(io_ctx, replay_image_id, "", 0);
+
         C_SaferCond replay_init_ctx;
         replay_journaler.init(&replay_init_ctx);
+        BOOST_SCOPE_EXIT_ALL( (&replay_journaler) ) {
+                replay_journaler.shut_down();
+        };
+
         r = replay_init_ctx.wait();
         if (r < 0) {
                 simple_err("failed to initialize replay journal", r);