diff options
author | Christian Brauner <brauner@kernel.org> | 2025-01-10 12:01:21 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2025-01-10 12:01:21 +0100 |
commit | 1623bc27a85a93e82194c8d077eccc464efa67db (patch) | |
tree | 491bd1e87d00a93d474579365add4d0dceb54fc1 /include/net | |
parent | afs: Fix merge preference rule failure condition (diff) | |
parent | Merge patch series "poll_wait: add mb() to fix theoretical race between waitq... (diff) | |
download | linux-1623bc27a85a93e82194c8d077eccc464efa67db.tar.xz linux-1623bc27a85a93e82194c8d077eccc464efa67db.zip |
Merge branch 'vfs-6.14.poll' into vfs.fixes
Bring in the fixes for __pollwait() and waitqueue_active() interactions.
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/sock.h | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/net/sock.h b/include/net/sock.h index c383126f691d..691ca7695d1d 100644 --- a/include/net/sock.h +++ b/include/net/sock.h @@ -2297,7 +2297,7 @@ static inline bool skwq_has_sleeper(struct socket_wq *wq) } /** - * sock_poll_wait - place memory barrier behind the poll_wait call. + * sock_poll_wait - wrapper for the poll_wait call. * @filp: file * @sock: socket to wait on * @p: poll_table @@ -2307,15 +2307,12 @@ static inline bool skwq_has_sleeper(struct socket_wq *wq) static inline void sock_poll_wait(struct file *filp, struct socket *sock, poll_table *p) { - if (!poll_does_not_wait(p)) { - poll_wait(filp, &sock->wq.wait, p); - /* We need to be sure we are in sync with the - * socket flags modification. - * - * This memory barrier is paired in the wq_has_sleeper. - */ - smp_mb(); - } + /* Provides a barrier we need to be sure we are in sync + * with the socket flags modification. + * + * This memory barrier is paired in the wq_has_sleeper. + */ + poll_wait(filp, &sock->wq.wait, p); } static inline void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk) |