Commit af295892 authored by Petr Malat's avatar Petr Malat Committed by Jakub Kicinski
Browse files

sctp: Do not wake readers in __sctp_write_space()



Function __sctp_write_space() doesn't set poll key, which leads to
ep_poll_callback() waking up all waiters, not only these waiting
for the socket being writable. Set the key properly using
wake_up_interruptible_poll(), which is preferred over the sync
variant, as writers are not woken up before at least half of the
queue is available. Also, TCP does the same.

Signed-off-by: default avatarPetr Malat <oss@malat.biz>
Acked-by: default avatarXin Long <lucien.xin@gmail.com>
Link: https://patch.msgid.link/20250516081727.1361451-1-oss@malat.biz


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 83d96231
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -9100,7 +9100,8 @@ static void __sctp_write_space(struct sctp_association *asoc)
		wq = rcu_dereference(sk->sk_wq);
		if (wq) {
			if (waitqueue_active(&wq->wait))
				wake_up_interruptible(&wq->wait);
				wake_up_interruptible_poll(&wq->wait, EPOLLOUT |
						EPOLLWRNORM | EPOLLWRBAND);

			/* Note that we try to include the Async I/O support
			 * here by modeling from the current TCP/UDP code.