netdev.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-u79uwXL29TY76Z2rM5mHXA, netdev-u79uwXL29TY76Z2rM5mHXA,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

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-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>

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 */
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2012-01-12 21:32 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
     [not found]       ` <4F0F3380.4000406-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2012-01-12 19:28         ` Trond Myklebust
     [not found]           ` <1326396510.6198.12.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2012-01-12 19:37             ` Tom Tucker
     [not found]     ` <1326395759.6198.7.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2012-01-12 19:28       ` J. Bruce Fields
     [not found]   ` <20120112162141.GC6563-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
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).