From d411ee26fb2f6cbe610f8bbc81b777cf28d839c2 Mon Sep 17 00:00:00 2001 From: Willem Jan Withagen Date: Wed, 28 Aug 2019 17:19:22 +0200 Subject: [PATCH] bluestore/bdev: initialize size when creating object. The other partss of the struct are initialized by their ctors. Only for unint_64 there is no ctor. Otherwise ceph-dencoder tests will fail in comparing the exported output. [~/master36] wjw@cephdev.digiware.nl> build/bin/ceph-dencoder type bluestore_bdev_label_t select_test 1 encode export /tmp/typ-yFISvjvgj [~/master36] wjw@cephdev.digiware.nl> hexdump -C !$ hexdump -C /tmp/typ-yFISvjvgj 00000000 62 6c 75 65 73 74 6f 72 65 20 62 6c 6f 63 6b 20 |bluestore block | 00000010 64 65 76 69 63 65 0a 30 30 30 30 30 30 30 30 2d |device.00000000-| 00000020 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 |0000-0000-0000-0| 00000030 30 30 30 30 30 30 30 30 30 30 30 0a 02 01 28 00 |00000000000...(.| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 70 74 03 04 00 00 00 00 00 00 00 00 00 00 |..pt............| 00000060 00 00 00 00 00 00 00 00 00 00 |..........| 0000006a [~/master36] wjw@cephdev.digiware.nl> build/bin/ceph-dencoder type bluestore_bdev_label_t select_test 1 encode decode encode export /tmp/typ-MjWXdCpzJ [~/master36] wjw@cephdev.digiware.nl> hexdump -C !$ hexdump -C /tmp/typ-MjWXdCpzJ 00000000 62 6c 75 65 73 74 6f 72 65 20 62 6c 6f 63 6b 20 |bluestore block | 00000010 64 65 76 69 63 65 0a 30 30 30 30 30 30 30 30 2d |device.00000000-| 00000020 30 30 30 30 2d 30 30 30 30 2d 30 30 30 30 2d 30 |0000-0000-0000-0| 00000030 30 30 30 30 30 30 30 30 30 30 30 0a 02 01 28 00 |00000000000...(.| 00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| 00000050 00 00 73 64 00 00 00 00 00 00 00 00 00 00 00 00 |..sd............| 00000060 00 00 00 00 00 00 00 00 00 00 |..........| 0000006a Signed-off-by: Willem Jan Withagen --- src/os/bluestore/bluestore_types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/bluestore/bluestore_types.h b/src/os/bluestore/bluestore_types.h index 867531c4e4f..10c62c00ae3 100644 --- a/src/os/bluestore/bluestore_types.h +++ b/src/os/bluestore/bluestore_types.h @@ -33,7 +33,7 @@ namespace ceph { /// label for block device struct bluestore_bdev_label_t { uuid_d osd_uuid; ///< osd uuid - uint64_t size; ///< device size + uint64_t size = 0; ///< device size utime_t btime; ///< birth time string description; ///< device description