From 8da803d0de050d63ab7342c8f6d09dc13e20f83b Mon Sep 17 00:00:00 2001 From: David Zafman Date: Thu, 13 Dec 2018 13:40:39 -0800 Subject: [PATCH] osd: shard_info_wrapper encode/decode need to fall through to *_FINISH() Fixes: http://tracker.ceph.com/issues/37653 Signed-off-by: David Zafman --- src/common/scrub_types.cc | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/common/scrub_types.cc b/src/common/scrub_types.cc index fa1f9a81049ca..d0385138bbdba 100644 --- a/src/common/scrub_types.cc +++ b/src/common/scrub_types.cc @@ -74,16 +74,15 @@ void shard_info_wrapper::encode(bufferlist& bl) const ENCODE_START(3, 3, bl); encode(errors, bl); encode(primary, bl); - if (has_shard_missing()) { - return; + if (!has_shard_missing()) { + encode(attrs, bl); + encode(size, bl); + encode(omap_digest_present, bl); + encode(omap_digest, bl); + encode(data_digest_present, bl); + encode(data_digest, bl); + encode(selected_oi, bl); } - encode(attrs, bl); - encode(size, bl); - encode(omap_digest_present, bl); - encode(omap_digest, bl); - encode(data_digest_present, bl); - encode(data_digest, bl); - encode(selected_oi, bl); ENCODE_FINISH(bl); } @@ -92,16 +91,15 @@ void shard_info_wrapper::decode(bufferlist::const_iterator& bp) DECODE_START(3, bp); decode(errors, bp); decode(primary, bp); - if (has_shard_missing()) { - return; + if (!has_shard_missing()) { + decode(attrs, bp); + decode(size, bp); + decode(omap_digest_present, bp); + decode(omap_digest, bp); + decode(data_digest_present, bp); + decode(data_digest, bp); + decode(selected_oi, bp); } - decode(attrs, bp); - decode(size, bp); - decode(omap_digest_present, bp); - decode(omap_digest, bp); - decode(data_digest_present, bp); - decode(data_digest, bp); - decode(selected_oi, bp); DECODE_FINISH(bp); } -- 2.39.5