]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: properly convert frag_t to net/store endianness
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 11 Nov 2025 15:15:03 +0000 (10:15 -0500)
committerPatrick Donnelly <pdonnell@ibm.com>
Tue, 2 Dec 2025 14:37:07 +0000 (09:37 -0500)
The MDS/client are already accidentally doing the right thing unless
they are running on a big-endian machine.

Credit to Venky Shankar for originally hypothesizing an endianness issue
with the frag_t.

Fixes: https://tracker.ceph.com/issues/73792
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
src/common/frag.cc

index 1f87d72504a0a3bfd89352330a19556ac7fb4eff..7297acd86c70b48f6ade6f201597639d23c24ffc 100644 (file)
@@ -32,13 +32,11 @@ bool frag_t::parse(const char *s) {
 }
 
 void frag_t::encode(ceph::buffer::list& bl) const {
-  ceph::encode_raw(_enc, bl);
+  ceph::encode(_enc, bl);
 }
 
 void frag_t::decode(ceph::buffer::list::const_iterator& p) {
-  __u32 v;
-  ceph::decode_raw(v, p);
-  _enc = v;
+  ceph::decode(_enc, p);
 }
 
 void frag_t::dump(ceph::Formatter *f) const {