]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
cls/rbd: use default values for non-decoded fields in test instances 64102/head
authorKefu Chai <tchaikov@gmail.com>
Sat, 14 Jun 2025 13:44:05 +0000 (21:44 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 23 Jun 2025 07:49:05 +0000 (09:49 +0200)
commit632f30a2f995354ca5b94a34215a2b22bc74d2da
tree01f775d745dc9613faa9099c9de70211950ee81b
parente01243e99c03d93e9e1597bce8d11d806a4cdfab
cls/rbd: use default values for non-decoded fields in test instances

Previously, test instances for cls_rbd_snap used non-default values
for the "parent" field, which is ignored during decoding. The
check-generated.sh test passed because they reused the same instance
for re-encoding, preserving undecoded fields.

An upcoming change will allocate new instances for each encode/decode
verification instead of reusing instances. This will expose
discrepancies between original test instances and re-encoded values
when fields contain non-default values but aren't decoded.

This change sets ignored fields to their default values in test
instances, ensuring consistency between encoding and decoding
operations regardless of the verification approach used.

Since the incompatibility of cls_rbd_snap's on-disk format was
introduced in 32b14ed1, which was introduced Ceph v14, we will
mark this version the first incompatible version in ceph-object-corpus
in the sense that the re-encoded cls_rbd_snap with v8 struct version
is different from the original copy if its parent field is set with
< v8 struct version.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
(cherry picked from commit a329b00579546ad2c069d792bde34cd44cfa0b43)
src/cls/rbd/cls_rbd.h