From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:50330 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753138AbeF2Nhg (ORCPT ); Fri, 29 Jun 2018 09:37:36 -0400 From: Christoph Hellwig 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 Message-Id: <20180629133725.17606-2-hch@lst.de> In-Reply-To: <20180629133725.17606-1-hch@lst.de> References: <20180629133725.17606-1-hch@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: 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 --- 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