linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] svcrdma: endian bug in send_write_chunks()
@ 2012-01-12  6:47 Dan Carpenter
  2012-01-12 16:21 ` J. Bruce Fields
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2012-01-12  6:47 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: J. Bruce Fields, David S. Miller, linux-nfs, netdev,
	kernel-janitors

Sparse complains because arg_ch->rs_length is declared as network
endian but we're treating it as CPU endian.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
index 249a835..30fda86 100644
--- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c
+++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c
@@ -409,7 +409,7 @@ static int send_write_chunks(struct svcxprt_rdma *xprt,
 		u64 rs_offset;
 
 		arg_ch = &arg_ary->wc_array[chunk_no].wc_target;
-		write_len = min(xfer_len, arg_ch->rs_length);
+		write_len = min(xfer_len, ntohl(arg_ch->rs_length));
 
 		/* Prepare the response chunk given the length actually
 		 * written */
@@ -481,7 +481,7 @@ static int send_reply_chunks(struct svcxprt_rdma *xprt,
 	     chunk_no++) {
 		u64 rs_offset;
 		ch = &arg_ary->wc_array[chunk_no].wc_target;
-		write_len = min(xfer_len, ch->rs_length);
+		write_len = min(xfer_len, ntohl(ch->rs_length));
 
 		/* Prepare the reply chunk given the length actually
 		 * written */

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-01-12 21:31 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-12  6:47 [patch] svcrdma: endian bug in send_write_chunks() Dan Carpenter
2012-01-12 16:21 ` J. Bruce Fields
2012-01-12 19:15   ` Trond Myklebust
2012-01-12 19:24     ` Tom Tucker
2012-01-12 19:28       ` Trond Myklebust
2012-01-12 19:37         ` Tom Tucker
2012-01-12 19:28     ` J. Bruce Fields
2012-01-12 21:32   ` Dan Carpenter

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).