Skip to content

Commit

Permalink
mptcp: never fetch fwd memory from the subflow
Browse files Browse the repository at this point in the history
The memory accounting is broken in such exceptional code
path, and after commit 4890b68 ("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>
  • Loading branch information
Paolo Abeni authored and David S. Miller committed Jul 1, 2022
1 parent 456bfd9 commit 4aaa168
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 4aaa168

Please sign in to comment.