Skip to content

Commit

Permalink
mptcp: drop WORKER_RUNNING status bit
Browse files Browse the repository at this point in the history
Only mptcp_close() can actually cancel the workqueue,
no need to add and use this flag.

Reviewed-by: Matthieu Baerts <matthieu.baerts@tessares.net>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Paolo Abeni authored and Jakub Kicinski committed Nov 20, 2020
1 parent 3cd336c commit b2771d2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
8 changes: 1 addition & 7 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,6 @@ static void mptcp_worker(struct work_struct *work)
int state, ret;

lock_sock(sk);
set_bit(MPTCP_WORKER_RUNNING, &msk->flags);
state = sk->sk_state;
if (unlikely(state == TCP_CLOSE))
goto unlock;
Expand Down Expand Up @@ -1940,7 +1939,6 @@ static void mptcp_worker(struct work_struct *work)
mptcp_reset_timer(sk);

unlock:
clear_bit(MPTCP_WORKER_RUNNING, &msk->flags);
release_sock(sk);
sock_put(sk);
}
Expand Down Expand Up @@ -2011,11 +2009,7 @@ static void mptcp_cancel_work(struct sock *sk)
{
struct mptcp_sock *msk = mptcp_sk(sk);

/* if called by the work itself, do not try to cancel the work, or
* we will hang.
*/
if (!test_bit(MPTCP_WORKER_RUNNING, &msk->flags) &&
cancel_work_sync(&msk->work))
if (cancel_work_sync(&msk->work))
__sock_put(sk);
}

Expand Down
1 change: 0 additions & 1 deletion net/mptcp/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@
#define MPTCP_WORK_EOF 3
#define MPTCP_FALLBACK_DONE 4
#define MPTCP_WORK_CLOSE_SUBFLOW 5
#define MPTCP_WORKER_RUNNING 6

static inline bool before64(__u64 seq1, __u64 seq2)
{
Expand Down

0 comments on commit b2771d2

Please sign in to comment.