]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/rbd-ggate: close log before running postfork 30858/head
authorWillem Jan Withagen <wjw@digiware.nl>
Thu, 29 Aug 2019 13:54:30 +0000 (15:54 +0200)
committerJason Dillaman <dillaman@redhat.com>
Thu, 10 Oct 2019 23:22:39 +0000 (19:22 -0400)
Otherwise the assert in Log:open() will trigger since
all data is kept during the fork and also the `is_started` flag

Fixes: https://tracker.ceph.com/issues/41592
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
(cherry picked from commit 21bdd4c6ecd24b2a7dbf8691705f228ac11481ad)

Conflicts:
src/tools/rbd_ggate/main.cc : Resolved in do_map

src/tools/rbd_ggate/main.cc

index 1a0e3140c2642c0a9bf3a4c35babf3c843ee8211..801b0093d1d6fa84607836a487c10a183a1a5829 100644 (file)
@@ -93,14 +93,13 @@ static int do_map(int argc, const char *argv[])
       cerr << err << std::endl;
       return r;
     }
-
     if (forker.is_parent()) {
-      global_init_postfork_start(g_ceph_context);
       if (forker.parent_wait(err) != 0) {
         return -ENXIO;
       }
       return 0;
     }
+    global_init_postfork_start(g_ceph_context);
   }
 
   common_init_finish(g_ceph_context);
@@ -174,9 +173,8 @@ static int do_map(int argc, const char *argv[])
   std::cout << "/dev/" << drv->get_devname() << std::endl;
 
   if (g_conf->daemonize) {
-    forker.daemonize();
-    global_init_postfork_start(g_ceph_context);
     global_init_postfork_finish(g_ceph_context);
+    forker.daemonize();
   }
 
   init_async_signal_handler();