Fixes for the AIO poll revert
Subsystems (4)
Two fixup for incorrectly reverted bits.
PATCH 1/2 net: handle NULL ->poll gracefully
The big aio poll revert broke various network protocols that don't implement ->poll as a patch in the aio poll serie removed sock_no_poll and made the common code handle this case.
--- net/socket.c | 2 ++ 1 file changed, 2 insertions(+)
net/socket.c +2 -0
@@ -1133,6 +1133,8 @@ static __poll_t sock_poll(struct file *file, poll_table *wait)__poll_t events =poll_requested_events (wait);sock_poll_busy_loop (sock, events); +if (!sock->ops->poll) +return 0 ;return sock->ops->poll (file, sock, wait) |sock_poll_busy_flag (sock); }
Signature · 1 line
2.18.0
Re: [PATCH 1/2] net: handle NULL ->poll gracefully
Quoted 4 lines · Christoph Hellwig
The big aio poll revert broke various network protocols that don't implement ->poll as a patch in the aio poll serie removed
sock_no_polland made the common code handle this case.
Hmm. I just did the revert of commit 984652dd8b1f ("net: remove sock_no_poll") in my tree.
But I haven't pushed it out, and your patch is certainly smaller/nicer than the revert.
That said, the revert does have the advantage of avoiding a conditional in the network poll() function (at the cost of a more expensive indirect call for when sock_no_poll actually triggers, but only "odd" network protocols have that).
Hmm. I'll have to think about it.
Linus
Re: [PATCH 1/2] net: handle NULL ->poll gracefully
Quoted 2 lines · Linus Torvalds
Hmm. I'll have to think about it.
I took yours over the revert. It's just smaller and nicer, and the conditional should predict fine for any case where it might matter.
Linus
PATCH 2/2 aio: mark __aio_sigset::sigmask const
In reply to Christoph HellwigFrom: Avi Kivity <[email protected]>
io_pgetevents() will not change the signal mask. Mark it const to make it clear and to reduce the need for casts in user code.
--- include/uapi/linux/aio_abi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/aio_abi.h +1 -1
@@ -111,7 +111,7 @@ struct iocb {#undef IFLITTLEstruct __aio_sigset { -sigset_t __user *sigmask; +const sigset_t __user *sigmask;size_t sigsetsize; };
Signature · 1 line
2.18.0