Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ceph: osd_client: fix endianness bug in osd_req_encode_op()

From Al Viro <viro@zeniv.linux.org.uk>

Al Viro noticed that we were using a non-cpu-encoded value in
a switch statement in osd_req_encode_op(). The result would
clearly not work correctly on a big-endian machine.

Signed-off-by: Alex Elder <elder@dreamhost.com>

authored by

Alex Elder and committed by
Alex Elder
065a68f9 8b393269

+1 -1
+1 -1
net/ceph/osd_client.c
··· 278 278 { 279 279 dst->op = cpu_to_le16(src->op); 280 280 281 - switch (dst->op) { 281 + switch (src->op) { 282 282 case CEPH_OSD_OP_READ: 283 283 case CEPH_OSD_OP_WRITE: 284 284 dst->extent.offset =