]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: init layout in ImageCtx ctor
authorSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 03:56:25 +0000 (20:56 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 03:56:25 +0000 (20:56 -0700)
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 <sage@inktank.com>
src/librbd/ImageCtx.cc

index 1fc338a642b4d4412a72ebb51337b1c605ddfb58..403908af51c40c3523d16cc2f6241b54275a1ff0 100644 (file)
@@ -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;