From 53b71ca1857885541f606832338d513b27f972f3 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Sun, 5 Oct 2025 17:18:49 +0530 Subject: [PATCH] snap_types: fix encode/decode for the newly added fiels in SnapRealmInfoNew Signed-off-by: Venky Shankar --- src/common/snap_types.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/snap_types.cc b/src/common/snap_types.cc index 05b19846af62e..0494458e2948c 100644 --- a/src/common/snap_types.cc +++ b/src/common/snap_types.cc @@ -61,7 +61,7 @@ std::list SnapRealmInfo::generate_test_instances() void SnapRealmInfoNew::encode(ceph::buffer::list& bl) const { using ceph::encode; - ENCODE_START(1, 1, bl); + ENCODE_START(2, 1, bl); encode(info, bl); encode(last_modified, bl); encode(change_attr, bl); @@ -72,11 +72,13 @@ void SnapRealmInfoNew::encode(ceph::buffer::list& bl) const void SnapRealmInfoNew::decode(ceph::buffer::list::const_iterator& bl) { using ceph::decode; - DECODE_START(1, bl); + DECODE_START(2, bl); decode(info, bl); decode(last_modified, bl); decode(change_attr, bl); - decode(flags, bl); + if (struct_v >= 2) { + decode(flags, bl); + } DECODE_FINISH(bl); } -- 2.39.5