Skip to content

Commit 34d4a2d

Browse files
author
Xin Long
committed
sctp: Do not wake readers in __sctp_write_space()
JIRA: https://issues.redhat.com/browse/RHEL-115641 Tested: compile only commit af29589 Author: Petr Malat <oss@malat.biz> Date: Fri May 16 10:17:28 2025 +0200 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: Petr Malat <oss@malat.biz> Acked-by: Xin Long <lucien.xin@gmail.com> Link: https://patch.msgid.link/20250516081727.1361451-1-oss@malat.biz Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Xin Long <lxin@redhat.com>
1 parent 6d87b50 commit 34d4a2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sctp/socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9100,7 +9100,8 @@ static void __sctp_write_space(struct sctp_association *asoc)
91009100
wq = rcu_dereference(sk->sk_wq);
91019101
if (wq) {
91029102
if (waitqueue_active(&wq->wait))
9103-
wake_up_interruptible(&wq->wait);
9103+
wake_up_interruptible_poll(&wq->wait, EPOLLOUT |
9104+
EPOLLWRNORM | EPOLLWRBAND);
91049105

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

0 commit comments

Comments
 (0)