diff mbox

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

Message ID 1310509259-29635-1-git-send-email-jaschut@sandia.gov (mailing list archive)
State New, archived
Headers show

Commit Message

Jim Schutt July 12, 2011, 10:20 p.m. UTC
Signed-off-by: Jim Schutt <jaschut@sandia.gov>
---
 src/crushtool.cc |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Sage Weil July 14, 2011, 4:39 a.m. UTC | #1
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


On Tue, 12 Jul 2011, Jim Schutt wrote:

> 
> Signed-off-by: Jim Schutt <jaschut@sandia.gov>
> ---
>  src/crushtool.cc |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/src/crushtool.cc b/src/crushtool.cc
> index f2a35f9..336d456 100644
> --- a/src/crushtool.cc
> +++ b/src/crushtool.cc
> @@ -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
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Colin Patrick McCabe July 19, 2011, 10:29 p.m. UTC | #2
Just to follow up on this thread, this was resolved by
56abfd89615c77287f091679e6be59045f05081a.

And thanks for the patch, Jim.

cheers,
Colin


On Wed, Jul 13, 2011 at 9:39 PM, Sage Weil <sage@newdream.net> wrote:
> 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
>
>
> On Tue, 12 Jul 2011, Jim Schutt wrote:
>
>>
>> Signed-off-by: Jim Schutt <jaschut@sandia.gov>
>> ---
>>  src/crushtool.cc |    4 ++++
>>  1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/crushtool.cc b/src/crushtool.cc
>> index f2a35f9..336d456 100644
>> --- a/src/crushtool.cc
>> +++ b/src/crushtool.cc
>> @@ -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
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/src/crushtool.cc b/src/crushtool.cc
index f2a35f9..336d456 100644
--- a/src/crushtool.cc
+++ b/src/crushtool.cc
@@ -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;