From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:43660 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726585AbeHBBmd (ORCPT ); Wed, 1 Aug 2018 21:42:33 -0400 Date: Thu, 2 Aug 2018 00:54:12 +0100 From: Al Viro To: Christoph Hellwig Cc: Avi Kivity , linux-aio@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/4] aio: implement IOCB_CMD_POLL Message-ID: <20180801235412.GT30522@ZenIV.linux.org.uk> References: <20180730071544.23998-1-hch@lst.de> <20180730071544.23998-4-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180730071544.23998-4-hch@lst.de> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Mon, Jul 30, 2018 at 09:15:43AM +0200, Christoph Hellwig wrote: > + apt.error = -EINVAL; /* same as no support for IOCB_CMD_POLL */ > + mask = vfs_poll(req->file, &apt.pt) & req->events; > + if (mask || apt.error) { > + bool removed = false; > + > + /* we did not manage to set up a waitqueue, done */ > + if (unlikely(!req->head)) > + goto out_fput; > +out_fput: > + fput(req->file); > + return apt.error; Ugh... So anything that simply returns a constant value, without even bothering to do poll_wait() (on the theory that no matter how much you wait, nothing will change) is going to git -EINVAL? What am I missing here?