From mboxrd@z Thu Jan 1 00:00:00 1970 From: Al Viro Subject: Re: [PATCH 6/6] fs: replace f_ops->get_poll_head with a static ->f_poll_head pointer Date: Thu, 28 Jun 2018 21:37:46 +0100 Message-ID: <20180628203746.GJ30522@ZenIV.linux.org.uk> References: <20180628142059.10017-1-hch@lst.de> <20180628142059.10017-7-hch@lst.de> <20180628181727.GH30522@ZenIV.linux.org.uk> <20180628202837.GI30522@ZenIV.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Christoph Hellwig , linux-fsdevel , Network Development , LKP To: Linus Torvalds Return-path: Received: from zeniv.linux.org.uk ([195.92.253.2]:41388 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753376AbeF1Uhs (ORCPT ); Thu, 28 Jun 2018 16:37:48 -0400 Content-Disposition: inline In-Reply-To: <20180628202837.GI30522@ZenIV.linux.org.uk> Sender: netdev-owner@vger.kernel.org List-ID: On Thu, Jun 28, 2018 at 09:28:37PM +0100, Al Viro wrote: > Sure. Unfortunately, adding yourself to the poll table is not the only > way to block. And a plenty of instances in e.g. drivers/media (where > the bulk of ->poll() instances lives) are very free with grabbing mutexes > as they go. Speaking of obvious bogosities (a lot more so than a blocking allocation several calls down into helper): static __poll_t ca8210_test_int_poll( struct file *filp, struct poll_table_struct *ptable ) { __poll_t return_flags = 0; struct ca8210_priv *priv = filp->private_data; poll_wait(filp, &priv->test.readq, ptable); if (!kfifo_is_empty(&priv->test.up_fifo)) return_flags |= (EPOLLIN | EPOLLRDNORM); if (wait_event_interruptible( priv->test.readq, !kfifo_is_empty(&priv->test.up_fifo))) { return EPOLLERR; } return return_flags; } In a sense, poll_wait() had been an unfortunate choice of name - it's really "arrange to be woken up by", not "wait for something now" and while the outright confusion like above is rare, general "blocking is OK in that area" is not rare at all...