From patchwork Fri Jun 29 13:37:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10496593 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ED93E60230 for ; Fri, 29 Jun 2018 13:37:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB3EB29807 for ; Fri, 29 Jun 2018 13:37:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE90B2980E; Fri, 29 Jun 2018 13:37:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 68EB129807 for ; Fri, 29 Jun 2018 13:37:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753656AbeF2Nhi (ORCPT ); Fri, 29 Jun 2018 09:37:38 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wXamAn0/rbvRolTdSYWmyqy1IQwamZG1b/ZhwmXstaE=; b=qwkEu15ZHrAJFcVjey0zassqf W+j0hb/Ml2IMzj3ZYVyVFHaQujqGjVE4j8/Q4NiLVWXnvFDCiFwq5gdEFgJufvgoOLOAerNVeAPgN MM4eHBEbqnyO+xEmyeEQUj7piQLTZCxXJOo3EHgaUjPLVj+MleSavHGnOeewc9sph1NXt0mB/k2x7 OLxLLOAwGjiL/mZBGbaOhx1pR4JhrLkHIkpWhS61GNLjwP19XTWtZn8HxG1Onx6zE6FPh75/cjx5h vssMFxVzP9e7WRPgsuH+KuVI6Ytmq3BW1kkgEJ3wUzzC3k8C+xW2N1P+GGxWZtrQ+dX2PuA/G4T6c BqYDLufRg==; Received: from 213-225-15-107.nat.highway.a1.net ([213.225.15.107] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fYtag-0008BY-QF; Fri, 29 Jun 2018 13:37:35 +0000 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> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180629133725.17606-1-hch@lst.de> References: <20180629133725.17606-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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); }