]> git-server-git.apps.pok.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:56:44 +0000 (17:26 +0530)
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit 53b71ca1857885541f606832338d513b27f972f3)
Resolves: rhbz#2400565
Resolves: https://jsw.ibm.com/browse/ISCE-1465

src/common/snap_types.cc

index ef0299f55f6beb8cdf1d9bdb89312946e9fa4ee8..ceb65390a1dd42ed3a27e90b096e8c6e3e4eb79d 100644 (file)
@@ -58,7 +58,7 @@ void SnapRealmInfo::generate_test_instances(std::list<SnapRealmInfo*>& 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);
 }