Commit b2771d24 authored by Paolo Abeni's avatar Paolo Abeni Committed by Jakub Kicinski

mptcp: drop WORKER_RUNNING status bit

Only mptcp_close() can actually cancel the workqueue,
no need to add and use this flag.
Reviewed-by: default avatarMatthieu Baerts <matthieu.baerts@tessares.net>
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 3cd336c5
...@@ -1862,7 +1862,6 @@ static void mptcp_worker(struct work_struct *work) ...@@ -1862,7 +1862,6 @@ static void mptcp_worker(struct work_struct *work)
int state, ret; int state, ret;
lock_sock(sk); lock_sock(sk);
set_bit(MPTCP_WORKER_RUNNING, &msk->flags);
state = sk->sk_state; state = sk->sk_state;
if (unlikely(state == TCP_CLOSE)) if (unlikely(state == TCP_CLOSE))
goto unlock; goto unlock;
...@@ -1940,7 +1939,6 @@ static void mptcp_worker(struct work_struct *work) ...@@ -1940,7 +1939,6 @@ static void mptcp_worker(struct work_struct *work)
mptcp_reset_timer(sk); mptcp_reset_timer(sk);
unlock: unlock:
clear_bit(MPTCP_WORKER_RUNNING, &msk->flags);
release_sock(sk); release_sock(sk);
sock_put(sk); sock_put(sk);
} }
...@@ -2011,11 +2009,7 @@ static void mptcp_cancel_work(struct sock *sk) ...@@ -2011,11 +2009,7 @@ static void mptcp_cancel_work(struct sock *sk)
{ {
struct mptcp_sock *msk = mptcp_sk(sk); struct mptcp_sock *msk = mptcp_sk(sk);
/* if called by the work itself, do not try to cancel the work, or if (cancel_work_sync(&msk->work))
* we will hang.
*/
if (!test_bit(MPTCP_WORKER_RUNNING, &msk->flags) &&
cancel_work_sync(&msk->work))
__sock_put(sk); __sock_put(sk);
} }
......
...@@ -91,7 +91,6 @@ ...@@ -91,7 +91,6 @@
#define MPTCP_WORK_EOF 3 #define MPTCP_WORK_EOF 3
#define MPTCP_FALLBACK_DONE 4 #define MPTCP_FALLBACK_DONE 4
#define MPTCP_WORK_CLOSE_SUBFLOW 5 #define MPTCP_WORK_CLOSE_SUBFLOW 5
#define MPTCP_WORKER_RUNNING 6
static inline bool before64(__u64 seq1, __u64 seq2) static inline bool before64(__u64 seq1, __u64 seq2)
{ {
......
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