On 9:43 14/12, Dave Chinner wrote: > 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? Well, if it is not supported, we'd rather let users decide how they want to handle it rather than manipulating the request in the kernel. For all you know, it could be a probe call to understand if RWF_NOWAIT is supported or not. > > 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 was not too happy getting it all the way down to block layer either. The multi-devices makes it worse. However, here we are and we need to tell the user that RWF_NOWAIT is not supported in this environment. > > 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.... Yes, I will send a patch to update the man page. -- Goldwyn