Skip to content

Commit 6a3ca4f

Browse files
Dan CarpenterSage Weil
authored andcommitted
rbd: endian bug in rbd_req_cb()
Sparse complains about this because: drivers/block/rbd.c:996:20: warning: cast to restricted __le32 drivers/block/rbd.c:996:20: warning: cast from restricted __le16 These are set in osd_req_encode_op() and they are le16. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Alex Elder <elder@inktank.com> (cherry picked from commit 895cfcc)
1 parent 236df37 commit 6a3ca4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/block/rbd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg)
977977
op = (void *)(replyhead + 1);
978978
rc = le32_to_cpu(replyhead->result);
979979
bytes = le64_to_cpu(op->extent.length);
980-
read_op = (le32_to_cpu(op->op) == CEPH_OSD_OP_READ);
980+
read_op = (le16_to_cpu(op->op) == CEPH_OSD_OP_READ);
981981

982982
dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc);
983983

0 commit comments

Comments
 (0)