From 7a3ccef89c5a1ac66f141475fca7f679a5200b9b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sun, 21 Oct 2012 20:56:25 -0700 Subject: [PATCH] librbd: init layout in ImageCtx ctor At (6): Non-static class member field "layout.fl_stripe_unit" is not initialized in this constructor nor in any functions that it calls. At (8): Non-static class member field "layout.fl_stripe_count" is not initialized in this constructor nor in any functions that it calls. At (10): Non-static class member field "layout.fl_object_size" is not initialized in this constructor nor in any functions that it calls. At (12): Non-static class member field "layout.fl_cas_hash" is not initialized in this constructor nor in any functions that it calls. At (14): Non-static class member field "layout.fl_object_stripe_unit" is not initialized in this constructor nor in any functions that it calls. At (16): Non-static class member field "layout.fl_unused" is not initialized in this constructor nor in any functions that it calls. CID 717224 (#1 of 1): Uninitialized scalar field (UNINIT_CTOR) At (18): Non-static class member field "layout.fl_pg_pool" is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Sage Weil --- src/librbd/ImageCtx.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 1fc338a642b4d..403908af51c40 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -55,6 +55,7 @@ namespace librbd { data_ctx.dup(p); memset(&header, 0, sizeof(header)); + memset(&layout, 0, sizeof(layout)); string pname = string("librbd-") + id + string("-") + data_ctx.get_pool_name() + string("/") + name; -- 2.39.5