From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ipmail06.adl6.internode.on.net ([150.101.137.145]:63875 "EHLO ipmail06.adl6.internode.on.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726457AbeLMWna (ORCPT ); Thu, 13 Dec 2018 17:43:30 -0500 Date: Fri, 14 Dec 2018 09:43:27 +1100 From: Dave Chinner To: Goldwyn Rodrigues Cc: linux-fsdevel@vger.kernel.org, linux-aio@kvack.org, avi@scylladb.com Subject: Re: [PATCH] fs: Return EOPNOTSUPP if block layer does not support REQ_NOWAIT Message-ID: <20181213224327.GE29416@dastard> References: <20181213115306.fm2mjc3qszjiwkgf@merlin> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181213115306.fm2mjc3qszjiwkgf@merlin> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Thu, Dec 13, 2018 at 05:53:06AM -0600, 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. Say what? Does this mean that if a filesystem supports RWF_NOWAIT, but the underlying block device/storage stack doesn't support it, then we'll getting EIO/EOPNOTSUPP errors returned to userspace? Isn't that highly unfriendly to userspace applications? i.e. instead of just ignoring RWF_NOWAIT in this case and having the AIO succeed, we return a /fatal/ error from deep in the guts of the IO subsystem that the user has no obvious way of tracking down? I'm also concerned that this is highly hardware dependent - two identical filesystems on different storage hardware on the same machine could behave differently. i.e. it works on one filesystem but not on the other, and there's no way to tell when it will work or fail apart from trying to use RWF_NOWAIT? I'd also like to point out that this errori (whether EIO or EOPNOTSUPP) is completely undocumented in the preadv2/pwritev2 man page, so application developers that get bug reports about EOPNOTSUPP errors are going to be rather confused.... Cheers, Dave. -- Dave Chinner david@fromorbit.com