linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: torvalds@linux-foundation.org
Cc: viro@zeniv.linux.org.uk, netdev@vger.kernel.org,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH 1/2] net: handle NULL ->poll gracefully
Date: Fri, 29 Jun 2018 15:37:24 +0200	[thread overview]
Message-ID: <20180629133725.17606-2-hch@lst.de> (raw)
In-Reply-To: <20180629133725.17606-1-hch@lst.de>

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

  reply	other threads:[~2018-06-29 13:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-29 13:37 Fixes for the AIO poll revert Christoph Hellwig
2018-06-29 13:37 ` Christoph Hellwig [this message]
2018-06-29 13:46   ` [PATCH 1/2] net: handle NULL ->poll gracefully 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180629133725.17606-2-hch@lst.de \
    --to=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).