Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
mptcp: lock meta in tcp_compressed_ack_kick
Browse files Browse the repository at this point in the history
commit 5d9f426 ("tcp: add SACK compression") from v4.18 adds a
timer, but this has not been adapted to MPTCP: it locks the subflow
instead of the meta.

Fixes: 0bc9477 ("Merge tag 'v4.19' into mptcp_trunk")
Signed-off-by: Tim Froidcoeur <[email protected]>
Acked-by: Christoph Paasch <[email protected]>
Signed-off-by: Matthieu Baerts <[email protected]>
(cherry picked from commit 8d8552e)
Signed-off-by: Matthieu Baerts <[email protected]>
(cherry picked from commit d9c97e6)
Signed-off-by: Matthieu Baerts <[email protected]>
  • Loading branch information
TimFroidcoeur authored and matttbe committed Aug 31, 2022
1 parent 1ac080e commit 10572d4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions net/ipv4/tcp_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,17 +771,18 @@ static enum hrtimer_restart tcp_compressed_ack_kick(struct hrtimer *timer)
{
struct tcp_sock *tp = container_of(timer, struct tcp_sock, compressed_ack_timer);
struct sock *sk = (struct sock *)tp;
struct sock *meta_sk = mptcp(tp) ? mptcp_meta_sk(sk) : sk;

bh_lock_sock(sk);
if (!sock_owned_by_user(sk)) {
bh_lock_sock(meta_sk);
if (!sock_owned_by_user(meta_sk)) {
if (tp->compressed_ack > TCP_FASTRETRANS_THRESH)
tcp_send_ack(sk);
} else {
if (!test_and_set_bit(TCP_DELACK_TIMER_DEFERRED,
&sk->sk_tsq_flags))
sock_hold(sk);
}
bh_unlock_sock(sk);
bh_unlock_sock(meta_sk);

sock_put(sk);

Expand Down

0 comments on commit 10572d4

Please sign in to comment.