Skip to content

Commit 53b71ca

Browse files
vshankardparmar18
authored andcommitted
snap_types: fix encode/decode for the newly added fiels in SnapRealmInfoNew
Signed-off-by: Venky Shankar <[email protected]>
1 parent ed231f7 commit 53b71ca

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/common/snap_types.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ std::list<SnapRealmInfo> SnapRealmInfo::generate_test_instances()
6161
void SnapRealmInfoNew::encode(ceph::buffer::list& bl) const
6262
{
6363
using ceph::encode;
64-
ENCODE_START(1, 1, bl);
64+
ENCODE_START(2, 1, bl);
6565
encode(info, bl);
6666
encode(last_modified, bl);
6767
encode(change_attr, bl);
@@ -72,11 +72,13 @@ void SnapRealmInfoNew::encode(ceph::buffer::list& bl) const
7272
void SnapRealmInfoNew::decode(ceph::buffer::list::const_iterator& bl)
7373
{
7474
using ceph::decode;
75-
DECODE_START(1, bl);
75+
DECODE_START(2, bl);
7676
decode(info, bl);
7777
decode(last_modified, bl);
7878
decode(change_attr, bl);
79-
decode(flags, bl);
79+
if (struct_v >= 2) {
80+
decode(flags, bl);
81+
}
8082
DECODE_FINISH(bl);
8183
}
8284

0 commit comments

Comments
 (0)