Skip to content

Commit

Permalink
mptcp: drop legacy code
Browse files Browse the repository at this point in the history
After the previous commits the PM worker can't race anymore
with the unaccepted subflow close and disposal, as the msk
keeps a reference to such subflow.

We can remove the now irrelevant and confusing checks explicitly
preventing the mentioned race.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
Paolo Abeni authored and matttbe committed Feb 20, 2023
1 parent b42ed58 commit ce29afc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 1 addition & 6 deletions net/mptcp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,12 +988,7 @@ static bool check_fully_established(struct mptcp_sock *msk, struct sock *ssk,
mptcp_subflow_fully_established(subflow, mp_opt);

check_notify:
/* if the subflow is not already linked into the conn_list, we can't
* notify the PM: this subflow is still on the listener queue
* and the PM possibly acquiring the subflow lock could race with
* the listener close
*/
if (likely(subflow->pm_notified) || list_empty(&subflow->node))
if (likely(subflow->pm_notified))
return true;

subflow->pm_notified = 1;
Expand Down
7 changes: 3 additions & 4 deletions net/mptcp/subflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,11 +1937,10 @@ static void subflow_ulp_release(struct sock *ssk)

sk = ctx->conn;
if (sk) {
/* if the msk has been orphaned, keep the ctx
* alive, will be freed by __mptcp_close_ssk(),
* when the subflow is still unaccepted
/* if the subflow has been closed by the TCP stack, keep
* the ctx alive, will be freed by __mptcp_close_ssk()
*/
release = ctx->disposable || list_empty(&ctx->node);
release = ctx->disposable;
sock_put(sk);
}

Expand Down

0 comments on commit ce29afc

Please sign in to comment.