diff mbox series

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

Message ID 20210317145204.7282-1-william.kucharski@oracle.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series net/rds: correct socket tunable error in rds_tcp_tune() | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Guessed tree name to be net-next
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cc_maintainers success CCed 6 of 6 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

William Kucharski March 17, 2021, 2:52 p.m. UTC
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 <william.kucharski@oracle.com>
---
 net/rds/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Matthew Wilcox March 19, 2021, 4:48 p.m. UTC | #1
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 <william.kucharski@oracle.com>

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")
diff mbox series

Patch

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