]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mptcp: never fetch fwd memory from the subflow
authorPaolo Abeni <pabeni@redhat.com>
Thu, 30 Jun 2022 22:17:54 +0000 (15:17 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Jul 2022 12:24:59 +0000 (13:24 +0100)
The memory accounting is broken in such exceptional code
path, and after commit 51d8ac882d1b ("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>
net/mptcp/protocol.c

index 883bea93c2aeecd27e655a46da503a0803e72032..9a6a4ab337dcf534258c88a4424f71e88230c760 100644 (file)
@@ -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;
 }