]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
global-init: check init flags and set accordingly
authorKarol Mroz <kmroz@suse.com>
Sat, 23 Apr 2016 11:36:01 +0000 (13:36 +0200)
committerKarol Mroz <kmroz@suse.com>
Sat, 23 Apr 2016 11:36:01 +0000 (13:36 +0200)
If init flags have changed between the time ceph context was
instantiated and now, update them. This can happen, for example, if
between manual global_pre_init() and global_init() calls, a daemon adds
modifies it's init flags.

Signed-off-by: Karol Mroz <kmroz@suse.com>
src/global/global_init.cc

index 9e9d6aa91c8d29d6e3041033414fcb9519b3f14e..f91a2d1d0adb4e9abc4880642c25ee935cb598a0 100644 (file)
@@ -148,6 +148,12 @@ void global_init(std::vector < const char * > *alt_def_args,
   }
   first_run = false;
 
+  // Verify flags have not changed if global_pre_init() has been called
+  // manually. If they have, update them.
+  if (g_ceph_context->get_init_flags() != flags) {
+    g_ceph_context->set_init_flags(flags);
+  }
+
   // signal stuff
   int siglist[] = { SIGPIPE, 0 };
   block_signals(siglist, NULL);