Skip to content

Commit

Permalink
net/smc: use sk_rcvbuf as start for rmb creation
Browse files Browse the repository at this point in the history
Commit 3e03472 ("net/smc: common functions for RMBs and send buffers")
merged handling of SMC receive and send buffers. It introduced sk_buf_size
as merged start value for size determination. But since sk_buf_size is not
used at all, sk_sndbuf is erroneously used as start for rmb creation.
This patch makes sure, sk_buf_size is really used as intended, and
sk_rcvbuf is used as start value for rmb creation.

Fixes: 3e03472 ("net/smc: common functions for RMBs and send buffers")
Signed-off-by: Ursula Braun <[email protected]>
Reviewed-by: Hans Wippel <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
braunu authored and davem330 committed Nov 23, 2017
1 parent bbfcd77 commit 4e1061f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/smc/smc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static int __smc_buf_create(struct smc_sock *smc, bool is_rmb)
/* use socket send buffer size (w/o overhead) as start value */
sk_buf_size = smc->sk.sk_sndbuf / 2;

for (bufsize_short = smc_compress_bufsize(smc->sk.sk_sndbuf / 2);
for (bufsize_short = smc_compress_bufsize(sk_buf_size);
bufsize_short >= 0; bufsize_short--) {

if (is_rmb) {
Expand Down

0 comments on commit 4e1061f

Please sign in to comment.