Commit 9758f40e authored by Paolo Abeni's avatar Paolo Abeni Committed by David S. Miller

mptcp: make the locking tx schema more readable

Florian noted the locking schema used by __mptcp_push_pending()
is hard to follow, let's add some more descriptive comments
and drop an unneeded and confusing check.
Suggested-by: default avatarFlorian Westphal <fw@strlen.de>
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 avatarDavid S. Miller <davem@davemloft.net>
parent f6c2ef59
...@@ -1515,15 +1515,19 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags) ...@@ -1515,15 +1515,19 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
mptcp_flush_join_list(msk); mptcp_flush_join_list(msk);
ssk = mptcp_subflow_get_send(msk); ssk = mptcp_subflow_get_send(msk);
/* try to keep the subflow socket lock across /* First check. If the ssk has changed since
* consecutive xmit on the same socket * the last round, release prev_ssk
*/ */
if (ssk != prev_ssk && prev_ssk) if (ssk != prev_ssk && prev_ssk)
mptcp_push_release(sk, prev_ssk, &info); mptcp_push_release(sk, prev_ssk, &info);
if (!ssk) if (!ssk)
goto out; goto out;
if (ssk != prev_ssk || !prev_ssk) /* Need to lock the new subflow only if different
* from the previous one, otherwise we are still
* helding the relevant lock
*/
if (ssk != prev_ssk)
lock_sock(ssk); lock_sock(ssk);
/* keep it simple and always provide a new skb for the /* keep it simple and always provide a new skb for the
......
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