Commit 0ea53742 authored by Paolo Abeni's avatar Paolo Abeni Committed by Jakub Kicinski

Revert "mptcp: add data lock for sk timers"

This reverts commit 4293248c.

Additional locks are not needed, all the touched sections
are already under mptcp socket lock protection.

Fixes: 4293248c ("mptcp: add data lock for sk timers")
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
Signed-off-by: default avatarMat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent c43ce398
...@@ -1613,10 +1613,8 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags) ...@@ -1613,10 +1613,8 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
out: out:
/* ensure the rtx timer is running */ /* ensure the rtx timer is running */
mptcp_data_lock(sk);
if (!mptcp_timer_pending(sk)) if (!mptcp_timer_pending(sk))
mptcp_reset_timer(sk); mptcp_reset_timer(sk);
mptcp_data_unlock(sk);
if (copied) if (copied)
__mptcp_check_send_data_fin(sk); __mptcp_check_send_data_fin(sk);
} }
...@@ -2529,10 +2527,8 @@ static void __mptcp_retrans(struct sock *sk) ...@@ -2529,10 +2527,8 @@ static void __mptcp_retrans(struct sock *sk)
reset_timer: reset_timer:
mptcp_check_and_set_pending(sk); mptcp_check_and_set_pending(sk);
mptcp_data_lock(sk);
if (!mptcp_timer_pending(sk)) if (!mptcp_timer_pending(sk))
mptcp_reset_timer(sk); mptcp_reset_timer(sk);
mptcp_data_unlock(sk);
} }
static void mptcp_mp_fail_no_response(struct mptcp_sock *msk) static void mptcp_mp_fail_no_response(struct mptcp_sock *msk)
...@@ -2711,10 +2707,8 @@ void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how) ...@@ -2711,10 +2707,8 @@ void mptcp_subflow_shutdown(struct sock *sk, struct sock *ssk, int how)
} else { } else {
pr_debug("Sending DATA_FIN on subflow %p", ssk); pr_debug("Sending DATA_FIN on subflow %p", ssk);
tcp_send_ack(ssk); tcp_send_ack(ssk);
mptcp_data_lock(sk);
if (!mptcp_timer_pending(sk)) if (!mptcp_timer_pending(sk))
mptcp_reset_timer(sk); mptcp_reset_timer(sk);
mptcp_data_unlock(sk);
} }
break; break;
} }
...@@ -2815,10 +2809,8 @@ static void __mptcp_destroy_sock(struct sock *sk) ...@@ -2815,10 +2809,8 @@ static void __mptcp_destroy_sock(struct sock *sk)
/* join list will be eventually flushed (with rst) at sock lock release time*/ /* join list will be eventually flushed (with rst) at sock lock release time*/
list_splice_init(&msk->conn_list, &conn_list); list_splice_init(&msk->conn_list, &conn_list);
mptcp_data_lock(sk);
mptcp_stop_timer(sk); mptcp_stop_timer(sk);
sk_stop_timer(sk, &sk->sk_timer); sk_stop_timer(sk, &sk->sk_timer);
mptcp_data_unlock(sk);
msk->pm.status = 0; msk->pm.status = 0;
/* clears msk->subflow, allowing the following loop to close /* clears msk->subflow, allowing the following loop to close
...@@ -2880,9 +2872,7 @@ static void mptcp_close(struct sock *sk, long timeout) ...@@ -2880,9 +2872,7 @@ static void mptcp_close(struct sock *sk, long timeout)
__mptcp_destroy_sock(sk); __mptcp_destroy_sock(sk);
do_cancel_work = true; do_cancel_work = true;
} else { } else {
mptcp_data_lock(sk);
sk_reset_timer(sk, &sk->sk_timer, jiffies + TCP_TIMEWAIT_LEN); sk_reset_timer(sk, &sk->sk_timer, jiffies + TCP_TIMEWAIT_LEN);
mptcp_data_unlock(sk);
} }
release_sock(sk); release_sock(sk);
if (do_cancel_work) if (do_cancel_work)
...@@ -2927,10 +2917,8 @@ static int mptcp_disconnect(struct sock *sk, int flags) ...@@ -2927,10 +2917,8 @@ static int mptcp_disconnect(struct sock *sk, int flags)
__mptcp_close_ssk(sk, ssk, subflow, MPTCP_CF_FASTCLOSE); __mptcp_close_ssk(sk, ssk, subflow, MPTCP_CF_FASTCLOSE);
} }
mptcp_data_lock(sk);
mptcp_stop_timer(sk); mptcp_stop_timer(sk);
sk_stop_timer(sk, &sk->sk_timer); sk_stop_timer(sk, &sk->sk_timer);
mptcp_data_unlock(sk);
if (mptcp_sk(sk)->token) if (mptcp_sk(sk)->token)
mptcp_event(MPTCP_EVENT_CLOSED, mptcp_sk(sk), NULL, GFP_KERNEL); mptcp_event(MPTCP_EVENT_CLOSED, mptcp_sk(sk), NULL, GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment