]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
snap_types: fix encode/decode for the newly added fiels in SnapRealmInfoNew
authorVenky Shankar <vshankar@redhat.com>
Sun, 5 Oct 2025 11:48:49 +0000 (17:18 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Mon, 6 Oct 2025 11:49:00 +0000 (17:19 +0530)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/common/snap_types.cc

index 05b19846af62e4838659a75d68d60356100419da..0494458e2948c1af916fc7f4869627b99e435082 100644 (file)
@@ -61,7 +61,7 @@ std::list<SnapRealmInfo> 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);
 }