From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from bombadil.infradead.org ([198.137.202.133]:49226 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727618AbeLMOYf (ORCPT ); Thu, 13 Dec 2018 09:24:35 -0500 Date: Thu, 13 Dec 2018 06:24:34 -0800 From: Christoph Hellwig To: Avi Kivity Cc: Goldwyn Rodrigues , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org Subject: Re: [PATCH] fs: Return EOPNOTSUPP if block layer does not support REQ_NOWAIT Message-ID: <20181213142434.GA3239@infradead.org> References: <20181213115306.fm2mjc3qszjiwkgf@merlin> <38b8f7a9-cf95-e165-4e9a-40ddcfe6bed2@scylladb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <38b8f7a9-cf95-e165-4e9a-40ddcfe6bed2@scylladb.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 13, 2018 at 02:04:41PM +0200, Avi Kivity wrote: > On 12/13/18 1:53 PM, Goldwyn Rodrigues wrote: > > For AIO+DIO with RWF_NOWAIT, if the block layer does not support REQ_NOWAIT, > > it returns EIO. Return EOPNOTSUPP to represent the correct error code. > > > Cc: stable@? > > > > Signed-off-by: Goldwyn Rodrigues > > --- > > fs/direct-io.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/fs/direct-io.c b/fs/direct-io.c > > index 41a0e97252ae..77adf33916b8 100644 > > --- a/fs/direct-io.c > > +++ b/fs/direct-io.c > > @@ -542,10 +542,13 @@ static blk_status_t dio_bio_complete(struct dio *dio, struct bio *bio) > > blk_status_t err = bio->bi_status; > > if (err) { I think this just need to become: if (err) dio->io_error = blk_status_to_errno(bio->bi_status); And Avi, you really should be using XFS ;-)