From: Venky Shankar Date: Sun, 5 Oct 2025 11:48:49 +0000 (+0530) Subject: snap_types: fix encode/decode for the newly added fiels in SnapRealmInfoNew X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=53b71ca1857885541f606832338d513b27f972f3;p=ceph.git snap_types: fix encode/decode for the newly added fiels in SnapRealmInfoNew Signed-off-by: Venky Shankar --- diff --git a/src/common/snap_types.cc b/src/common/snap_types.cc index 05b19846af62..0494458e2948 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); }