]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/rbd: fsx needs to shut down the journal 9459/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 2 Jun 2016 14:41:18 +0000 (10:41 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 2 Jun 2016 14:41:18 +0000 (10:41 -0400)
Fixes: http://tracker.ceph.com/issues/16123
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/fsx.cc

index daee85e22055c5a0f6945d87d48dfade817406b7..c52f3ecd83908c3720316415920c18bc762723ec 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 */
 
 /*
@@ -395,6 +397,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);
@@ -402,8 +408,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);