]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: skip the buffer in UnknownPayload::decode() 40682/head
authorXiubo Li <xiubli@redhat.com>
Fri, 26 Mar 2021 07:57:47 +0000 (15:57 +0800)
committersinguliere <singuliere@autistici.org>
Fri, 9 Apr 2021 05:27:49 +0000 (07:27 +0200)
If it receiving an unknown type of metric, it should skip the buffer
when dropping it. Or it will cause corruption.

Fixes: https://tracker.ceph.com/issues/49972
Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit fb782d4512be1ea130a5953f6067901a939e467d)

src/include/cephfs/metrics/Types.h

index 3f2b642fdb3d54e9c16d736339796a20355b9958..5843a1ed0fb737e861e5ead9b8ff794452472f5b 100644 (file)
@@ -367,6 +367,10 @@ struct UnknownPayload {
   }
 
   void decode(bufferlist::const_iterator &iter) {
+    using ceph::decode;
+    DECODE_START(254, iter);
+    iter.seek(struct_len);
+    DECODE_FINISH(iter);
   }
 
   void dump(Formatter *f) const {