diff options
author | Paolo Abeni <pabeni@redhat.com> | 2020-11-19 11:45:54 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-20 15:33:24 -0800 |
commit | b2771d2419fa6e978dec9ba6ccb93c5c76106374 (patch) | |
tree | cfbbab69c9633e9aab7a5fbda7423b8a3dd8aaa3 | |
parent | 3cd336c517990850897f50845270be216d2aaca8 (diff) | |
download | linux-stable-b2771d2419fa6e978dec9ba6ccb93c5c76106374.tar.gz linux-stable-b2771d2419fa6e978dec9ba6ccb93c5c76106374.tar.bz2 linux-stable-b2771d2419fa6e978dec9ba6ccb93c5c76106374.zip |
mptcp: drop WORKER_RUNNING status bit
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>
-rw-r--r-- | net/mptcp/protocol.c | 8 | ||||
-rw-r--r-- | net/mptcp/protocol.h | 1 |
2 files changed, 1 insertions, 8 deletions
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index aeda4357de9a..1aaf58c59f41 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -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; @@ -1940,7 +1939,6 @@ reset_unlock: mptcp_reset_timer(sk); unlock: - clear_bit(MPTCP_WORKER_RUNNING, &msk->flags); release_sock(sk); sock_put(sk); } @@ -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); } diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index b4c8dbe9236b..10fffc5de9e4 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -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) { |