Skip to contentSkip to conversation

SUNRPC: Address a signed v. unsigned comparison in net/sunrpc/xprtsock.

PATCH In review Chuck Lever 2 participants 2 messages Aug 6, 2007 – Aug 11, 2007

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 5/20 SUNRPC: Address a signed v. unsigned comparison in net/sunrpc/xprtsock.

---

 net/sunrpc/xprtsock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtsock.c +1 -1
index 7448402..505a7e3 100644
@@ -852,7 +852,7 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea
 		transport->tcp_copied += r;
 		transport->tcp_offset += r;
 	}
-	if (r != len) {
+	if (r != (ssize_t) len) {
 		/* Error when copying to the receive buffer,
 		 * usually because we weren't able to allocate
 		 * additional buffer pages. All we can do now

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

#1 lore raw
Quoted 11 lines · Chuck Lever

---

 net/sunrpc/xprtsock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/sunrpc/xprtsock.c +0 -0
index 7448402..505a7e3 100644

net/sunrpc/xprtsock.c static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea · line 858

Quoted 8 lines
net/sunrpc/xprtsock.c +1 -1
@@ -852,7 +852,7 @@ static inline void xs_tcp_read_request(struct rpc_xprt *xprt, struct xdr_skb_rea
 		transport->tcp_copied += r;
 		transport->tcp_offset += r;
 	}
-	if (r != len) {
+	if (r != (ssize_t) len) {
 		/* Error when copying to the receive buffer,
 		 * usually because we weren't able to allocate
 		 * additional buffer pages. All we can do now

NACK. For the same reason as the last rejection. There is no reason to introduce an explicit cast, and it will only serve to obfuscate if we ever change the types of r or len.

Trond

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs