Skip to content

Commit

Permalink
mptcp: move subflow close loop after sk close check
Browse files Browse the repository at this point in the history
In case mptcp socket is already dead the entire mptcp socket
will be freed. We can avoid the close check in this case.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Feb 13, 2021
1 parent 40947e1 commit b263b0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2246,9 +2246,6 @@ static void mptcp_worker(struct work_struct *work)

mptcp_check_fastclose(msk);

if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
__mptcp_close_subflow(msk);

if (msk->pm.status)
mptcp_pm_nl_work(msk);

Expand All @@ -2270,6 +2267,9 @@ static void mptcp_worker(struct work_struct *work)
goto unlock;
}

if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))
__mptcp_close_subflow(msk);

if (!test_and_clear_bit(MPTCP_WORK_RTX, &msk->flags))
goto unlock;

Expand Down

0 comments on commit b263b0d

Please sign in to comment.