Skip to contentSkip to conversation

crushtool: Add call to global_init() to avoid dout segfault

PATCH In review Jim Schutt 3 participants 3 messages Jul 12, 2011 – Jul 19, 2011

lore
Share & tools
lore

Jim Schutt

author
#0 lore raw

PATCH 1/1 crushtool: Add call to global_init() to avoid dout segfault

---
 src/crushtool.cc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
src/crushtool.cc +4 -0
index f2a35f9..336d456 100644
@@ -845,6 +845,10 @@ int main(int argc, const char **argv)
   map<int, int> device_weight;
   DEFINE_CONF_VARS(usage);
 
+  global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
+	      CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+  common_init_finish(g_ceph_context);
+
   FOR_EACH_ARG(args) {
     if (CEPH_ARGPARSE_EQ("clobber", '\0')) {
       clobber = true;
Signature · 1 line
1.7.1
#1 lore raw

Hey Colin,

I applied this to stable, but now crushtool is trying to read ceph.conf, despite CINIT_FLAG_NO_DEFAULT_CONFIG_FILE... I fixed it up in wip-default-conf, can you take a look?

thanks!
sage

Quoted 31 lines · Jim Schutt
---
 src/crushtool.cc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
src/crushtool.cc +4 -0
index f2a35f9..336d456 100644
@@ -845,6 +845,10 @@ int main(int argc, const char **argv)
   map<int, int> device_weight;
   DEFINE_CONF_VARS(usage);
 
+  global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
+	      CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+  common_init_finish(g_ceph_context);
+
   FOR_EACH_ARG(args) {
     if (CEPH_ARGPARSE_EQ("clobber", '\0')) {
       clobber = true;
Signature · 7 lines
1.7.1


--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

Just to follow up on this thread, this was resolved by 56abfd89615c77287f091679e6be59045f05081a.

And thanks for the patch, Jim.

cheers,
Colin

Quoted 37 lines · Sage Weil

Hey Colin,

I applied this to stable, but now crushtool is trying to read ceph.conf, despite CINIT_FLAG_NO_DEFAULT_CONFIG_FILE... I fixed it up in wip-default-conf, can you take a look?

thanks!
sage

Quoted 25 lines · Jim Schutt

---
 src/crushtool.cc |    4 ++++

 1 files changed, 4 insertions(+), 0 deletions(-)
src/crushtool.cc +4 -1
index f2a35f9..336d456 100644
@@ -845,6 +845,10 @@ int main(int argc, const char **argv)
    map<int, int> device_weight;
    DEFINE_CONF_VARS(usage);
 
+  global_init(args, CEPH_ENTITY_TYPE_CLIENT, CODE_ENVIRONMENT_UTILITY,
+           CINIT_FLAG_NO_DEFAULT_CONFIG_FILE);
+  common_init_finish(g_ceph_context);
+
    FOR_EACH_ARG(args) {
      if (CEPH_ARGPARSE_EQ("clobber", '\0')) {
        clobber = true;
--

1.7.1

Quoted 7 lines
Quoted 6 lines

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html