linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fixes for the AIO poll revert
@ 2018-06-29 13:37 Christoph Hellwig
  2018-06-29 13:37 ` [PATCH 1/2] net: handle NULL ->poll gracefully Christoph Hellwig
  2018-06-29 13:37 ` [PATCH 2/2] aio: mark __aio_sigset::sigmask const Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Christoph Hellwig @ 2018-06-29 13:37 UTC (permalink / raw)
  To: torvalds; +Cc: viro, netdev, linux-fsdevel

Two fixup for incorrectly reverted bits.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] net: handle NULL ->poll gracefully
  2018-06-29 13:37 Fixes for the AIO poll revert Christoph Hellwig
@ 2018-06-29 13:37 ` Christoph Hellwig
  2018-06-29 13:46   ` Linus Torvalds
  2018-06-29 13:37 ` [PATCH 2/2] aio: mark __aio_sigset::sigmask const Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2018-06-29 13:37 UTC (permalink / raw)
  To: torvalds; +Cc: viro, netdev, linux-fsdevel

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.

Fixes: a11e1d43 ("Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 net/socket.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/socket.c b/net/socket.c
index a564c6ed19d5..85633622c94d 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -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);
 }
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] aio: mark __aio_sigset::sigmask const
  2018-06-29 13:37 Fixes for the AIO poll revert Christoph Hellwig
  2018-06-29 13:37 ` [PATCH 1/2] net: handle NULL ->poll gracefully Christoph Hellwig
@ 2018-06-29 13:37 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2018-06-29 13:37 UTC (permalink / raw)
  To: torvalds; +Cc: viro, netdev, linux-fsdevel, Avi Kivity

From: Avi Kivity <avi@scylladb.com>

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.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Avi Kivity <avi@scylladb.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[hch: reapply the patch that got incorrectly reverted]
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 include/uapi/linux/aio_abi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/linux/aio_abi.h b/include/uapi/linux/aio_abi.h
index d4e768d55d14..3c5038b587ba 100644
--- a/include/uapi/linux/aio_abi.h
+++ b/include/uapi/linux/aio_abi.h
@@ -111,7 +111,7 @@ struct iocb {
 #undef IFLITTLE
 
 struct __aio_sigset {
-	sigset_t __user	*sigmask;
+	const sigset_t __user	*sigmask;
 	size_t		sigsetsize;
 };
 
-- 
2.18.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] net: handle NULL ->poll gracefully
  2018-06-29 13:37 ` [PATCH 1/2] net: handle NULL ->poll gracefully Christoph Hellwig
@ 2018-06-29 13:46   ` Linus Torvalds
  2018-06-29 13:53     ` Linus Torvalds
  0 siblings, 1 reply; 5+ messages in thread
From: Linus Torvalds @ 2018-06-29 13:46 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Al Viro, Network Development, linux-fsdevel

On Fri, Jun 29, 2018 at 6:37 AM Christoph Hellwig <hch@lst.de> wrote:
>
> 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.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] net: handle NULL ->poll gracefully
  2018-06-29 13:46   ` Linus Torvalds
@ 2018-06-29 13:53     ` Linus Torvalds
  0 siblings, 0 replies; 5+ messages in thread
From: Linus Torvalds @ 2018-06-29 13:53 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Al Viro, Network Development, linux-fsdevel

On Fri, Jun 29, 2018 at 6:46 AM Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-06-29 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-29 13:37 Fixes for the AIO poll revert Christoph Hellwig
2018-06-29 13:37 ` [PATCH 1/2] net: handle NULL ->poll gracefully Christoph Hellwig
2018-06-29 13:46   ` Linus Torvalds
2018-06-29 13:53     ` Linus Torvalds
2018-06-29 13:37 ` [PATCH 2/2] aio: mark __aio_sigset::sigmask const Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).