* [patch] rbd: endian bug in rbd_req_cb()
@ 2012-05-04 17:39 Dan Carpenter
2012-06-06 13:55 ` Alex Elder
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2012-05-04 17:39 UTC (permalink / raw)
To: Yehuda Sadeh; +Cc: Sage Weil, ceph-devel, kernel-janitors
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>
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index c1f7701..64d3d6f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -993,7 +993,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg)
op = (void *)(replyhead + 1);
rc = le32_to_cpu(replyhead->result);
bytes = le64_to_cpu(op->extent.length);
- read_op = (le32_to_cpu(op->op) = CEPH_OSD_OP_READ);
+ read_op = (le16_to_cpu(op->op) = CEPH_OSD_OP_READ);
dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc);
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch] rbd: endian bug in rbd_req_cb()
2012-05-04 17:39 [patch] rbd: endian bug in rbd_req_cb() Dan Carpenter
@ 2012-06-06 13:55 ` Alex Elder
0 siblings, 0 replies; 2+ messages in thread
From: Alex Elder @ 2012-06-06 13:55 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Yehuda Sadeh, Sage Weil, ceph-devel, kernel-janitors
On 05/04/2012 12:39 PM, Dan Carpenter wrote:
> 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.
I had made a note to myself to fix this as well--and have a whole
series of patches in my queue related to improving consistency with
sizes and signedness.
Thank you for sending this, it looks good and I'm about to commit it.
Reviewed-by: Alex Elder <elder@inktank.com>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index c1f7701..64d3d6f 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -993,7 +993,7 @@ static void rbd_req_cb(struct ceph_osd_request *req, struct ceph_msg *msg)
> op = (void *)(replyhead + 1);
> rc = le32_to_cpu(replyhead->result);
> bytes = le64_to_cpu(op->extent.length);
> - read_op = (le32_to_cpu(op->op) = CEPH_OSD_OP_READ);
> + read_op = (le16_to_cpu(op->op) = CEPH_OSD_OP_READ);
>
> dout("rbd_req_cb bytes=%lld readop=%d rc=%d\n", bytes, read_op, rc);
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-06-06 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-04 17:39 [patch] rbd: endian bug in rbd_req_cb() Dan Carpenter
2012-06-06 13:55 ` Alex Elder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).