@@ -833,19 +833,25 @@ static void mptcp_clean_una(struct sock *sk)
}
out:
- if (cleaned) {
+ if (cleaned)
sk_mem_reclaim_partial(sk);
+}
- /* Only wake up writers if a subflow is ready */
- if (mptcp_is_writeable(msk)) {
- set_bit(MPTCP_SEND_SPACE, &mptcp_sk(sk)->flags);
- smp_mb__after_atomic();
+static void mptcp_clean_una_wakeup(struct sock *sk)
+{
+ struct mptcp_sock *msk = mptcp_sk(sk);
- /* set SEND_SPACE before sk_stream_write_space clears
- * NOSPACE
- */
- sk_stream_write_space(sk);
- }
+ mptcp_clean_una(sk);
+
+ /* Only wake up writers if a subflow is ready */
+ if (mptcp_is_writeable(msk)) {
+ set_bit(MPTCP_SEND_SPACE, &msk->flags);
+ smp_mb__after_atomic();
+
+ /* set SEND_SPACE before sk_stream_write_space clears
+ * NOSPACE
+ */
+ sk_stream_write_space(sk);
}
}
@@ -1751,7 +1757,7 @@ static void mptcp_worker(struct work_struct *work)
long timeo = 0;
lock_sock(sk);
- mptcp_clean_una(sk);
+ mptcp_clean_una_wakeup(sk);
mptcp_check_data_fin_ack(sk);
__mptcp_flush_join_list(msk);
if (test_and_clear_bit(MPTCP_WORK_CLOSE_SUBFLOW, &msk->flags))