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-Tag: testing/wip-pdonnell-testing-20260323.122957-tentacle~472 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=68f7f8c2a7178714102ca78e4cf533d9dfba215e;p=ceph-ci.git snap_types: fix encode/decode for the newly added fiels in SnapRealmInfoNew Signed-off-by: Venky Shankar (cherry picked from commit 53b71ca1857885541f606832338d513b27f972f3) Resolves: rhbz#2400565 Resolves: https://jsw.ibm.com/browse/ISCE-1465 --- diff --git a/src/common/snap_types.cc b/src/common/snap_types.cc index ef0299f55f6..ceb65390a1d 100644 --- a/src/common/snap_types.cc +++ b/src/common/snap_types.cc @@ -58,7 +58,7 @@ void SnapRealmInfo::generate_test_instances(std::list& o) 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); @@ -69,11 +69,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); }