]> git-server-git.apps.pok.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>
Sat, 6 Dec 2025 00:57:55 +0000 (19:57 -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>
(cherry picked from commit 9e3837c837bc9f76805f998dd06fe386dce35722)

src/common/frag.cc

index 3d2f820fe4753768a8e8dfe122eb341c6a7818c9..13a8e154559346e07295c2df91d0043b4d3b139b 100644 (file)
@@ -31,13 +31,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 {