[PATCH] net/rds: correct socket tunable error in rds_tcp_tune()

Subsystems: networking [general], rds - reliable datagram sockets, the rest

STALE1999d

3 messages, 3 authors, 2021-03-19 · open the first message on its own page

[PATCH] net/rds: correct socket tunable error in rds_tcp_tune()

From: William Kucharski <hidden>
Date: 2021-03-17 18:28:57

Correct an error where setting /proc/sys/net/rds/tcp/rds_tcp_rcvbuf would
instead modify the socket's sk_sndbuf and would leave sk_rcvbuf untouched.

Signed-off-by: William Kucharski <redacted>
---
 net/rds/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/rds/tcp.c b/net/rds/tcp.c
index 43db0eca911f..130e5988f956 100644
--- a/net/rds/tcp.c
+++ b/net/rds/tcp.c
@@ -500,7 +500,7 @@ void rds_tcp_tune(struct socket *sock)
 		sk->sk_userlocks |= SOCK_SNDBUF_LOCK;
 	}
 	if (rtn->rcvbuf_size > 0) {
-		sk->sk_sndbuf = rtn->rcvbuf_size;
+		sk->sk_rcvbuf = rtn->rcvbuf_size;
 		sk->sk_userlocks |= SOCK_RCVBUF_LOCK;
 	}
 	release_sock(sk);
-- 
2.30.2

Re: [PATCH] net/rds: correct socket tunable error in rds_tcp_tune()

From: Santosh Shilimkar <hidden>
Date: 2021-03-17 17:19:10

(Previous reply bounced due to format so re-sending to the list for archives)

On Mar 17, 2021, at 7:52 AM, William Kucharski [off-list ref] wrote:
Correct an error where setting /proc/sys/net/rds/tcp/rds_tcp_rcvbuf would
instead modify the socket's sk_sndbuf and would leave sk_rcvbuf untouched.

Signed-off-by: William Kucharski <redacted>
—
Looks good. Thanks !!
Acked-by: Santosh Shilimkar <redacted>

Re: [PATCH] net/rds: correct socket tunable error in rds_tcp_tune()

From: Matthew Wilcox <willy@infradead.org>
Date: 2021-03-19 16:49:47

On Wed, Mar 17, 2021 at 08:52:04AM -0600, William Kucharski wrote:
Correct an error where setting /proc/sys/net/rds/tcp/rds_tcp_rcvbuf would
instead modify the socket's sk_sndbuf and would leave sk_rcvbuf untouched.

Signed-off-by: William Kucharski <redacted>
Looks like a pretty clear copy-n-paste error.  I think Coverity have
started looking for issues like this?

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Also, maybe,

Fixes: c6a58ffed536 ("RDS: TCP: Add sysctl tunables for sndbuf/rcvbuf on rds-tcp socket")
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help