From b8c7baec841e9fecc8abfb4e1578b0a5675f9cd7 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Wed, 21 Jan 2015 17:47:20 +0000 Subject: [PATCH] include/util.h: initialize ceph_data_stats to zero We decode this struct on the monitor. Although at the moment there's no reports of any weird behavior by not initializing it, let's avoid it completely by setting member values to zero -- just in case and because it's a good policy. Signed-off-by: Joao Eduardo Luis --- src/include/util.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/include/util.h b/src/include/util.h index 4e4476ad644c9..7801d0654c467 100644 --- a/src/include/util.h +++ b/src/include/util.h @@ -30,6 +30,13 @@ struct ceph_data_stats uint64_t byte_avail; int avail_percent; + ceph_data_stats() : + byte_total(0), + byte_used(0), + byte_avail(0), + avail_percent(0) + { } + void dump(Formatter *f) const { assert(f != NULL); f->dump_int("total", byte_total); -- 2.39.5