summaryrefslogtreecommitdiff
path: root/net/mptcp
diff options
context:
space:
mode:
authorPaolo Abeni <pabeni@redhat.com>2022-06-30 15:17:54 -0700
committerDavid S. Miller <davem@davemloft.net>2022-07-01 13:24:59 +0100
commit4aaa1685f750b293316d2a09cde2ea25be2a5de2 (patch)
treec55e1eb75f8b4f1f51b7eebde87246c780572313 /net/mptcp
parent456bfd9dc8a11213f665a28d49010ee1d31547c4 (diff)
mptcp: never fetch fwd memory from the subflow
The memory accounting is broken in such exceptional code path, and after commit 4890b686f408 ("net: keep sk->sk_forward_alloc as small as possible") we can't find much help there. Drop the broken code. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/mptcp')
-rw-r--r--net/mptcp/protocol.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 883bea93c2ae..9a6a4ab337dc 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -328,15 +328,10 @@ static bool mptcp_rmem_schedule(struct sock *sk, struct sock *ssk, int size)
amt = sk_mem_pages(size);
amount = amt << PAGE_SHIFT;
- msk->rmem_fwd_alloc += amount;
- if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV)) {
- if (ssk->sk_forward_alloc < amount) {
- msk->rmem_fwd_alloc -= amount;
- return false;
- }
+ if (!__sk_mem_raise_allocated(sk, size, amt, SK_MEM_RECV))
+ return false;
- ssk->sk_forward_alloc -= amount;
- }
+ msk->rmem_fwd_alloc += amount;
return true;
}