From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 2/8] nowait aio: Introduce RWF_NOWAIT To: Christoph Hellwig References: <20170414120257.8932-1-rgoldwyn@suse.de> <20170414120257.8932-3-rgoldwyn@suse.de> <20170419063930.GB20053@infradead.org> Cc: linux-fsdevel@vger.kernel.org, jack@suse.com, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, sagi@grimberg.me, avi@scylladb.com, axboe@kernel.dk, linux-api@vger.kernel.org, willy@infradead.org, tom.leiming@gmail.com From: Goldwyn Rodrigues Message-ID: <2d816e3e-3625-7ebd-8550-68a7cc9c1a2e@suse.de> Date: Wed, 19 Apr 2017 05:30:24 -0500 MIME-Version: 1.0 In-Reply-To: <20170419063930.GB20053@infradead.org> Content-Type: text/plain; charset=windows-1252 List-ID: On 04/19/2017 01:39 AM, Christoph Hellwig wrote: > >> @@ -1593,6 +1593,11 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, >> } >> >> req->common.ki_flags |= iocb_rw_flags(iocb->aio_rw_flags); >> + if ((req->common.ki_flags & IOCB_NOWAIT) && >> + !(req->common.ki_flags & IOCB_DIRECT)) { >> + ret = -EINVAL; >> + goto out_put_req; >> + } > > Wrong indentation. Also I think this should be EOPNOTSUPP here. > Do we plan to add support for nowait in buffered I/O in the future? It is just too complicated. EINVAL suits best in this case. -- Goldwyn From mboxrd@z Thu Jan 1 00:00:00 1970 From: Goldwyn Rodrigues Subject: Re: [PATCH 2/8] nowait aio: Introduce RWF_NOWAIT Date: Wed, 19 Apr 2017 05:30:24 -0500 Message-ID: <2d816e3e-3625-7ebd-8550-68a7cc9c1a2e@suse.de> References: <20170414120257.8932-1-rgoldwyn@suse.de> <20170414120257.8932-3-rgoldwyn@suse.de> <20170419063930.GB20053@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, jack-IBi9RG/b67k@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-btrfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-ext4-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-xfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, sagi-NQWnxTmZq1alnMjI0IkVqw@public.gmane.org, avi-VrcmuVmyx1hWk0Htik3J/w@public.gmane.org, axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, willy-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org, tom.leiming-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org To: Christoph Hellwig Return-path: In-Reply-To: <20170419063930.GB20053-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-ext4.vger.kernel.org On 04/19/2017 01:39 AM, Christoph Hellwig wrote: > >> @@ -1593,6 +1593,11 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, >> } >> >> req->common.ki_flags |= iocb_rw_flags(iocb->aio_rw_flags); >> + if ((req->common.ki_flags & IOCB_NOWAIT) && >> + !(req->common.ki_flags & IOCB_DIRECT)) { >> + ret = -EINVAL; >> + goto out_put_req; >> + } > > Wrong indentation. Also I think this should be EOPNOTSUPP here. > Do we plan to add support for nowait in buffered I/O in the future? It is just too complicated. EINVAL suits best in this case. -- Goldwyn