Re: [PATCH] fs: Return EOPNOTSUPP if block layer does not support REQ_NOWAIT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 14, 2018 at 11:09:10AM -0600, Goldwyn Rodrigues wrote:
> 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.

So even though the filesystem supports it and the app can avaoid
blocking on filesystem locks (the biggest problem they have by far),
we're going to prevent the filesystems from being non-blocking
because the underlying block device isn't non blocking?

That amkes no sense to me at all.

> > 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.

RWF_NOWAIT matters for filesystems much more than the underlying
block device. If the application is accessing the blockd evice
directly, then yes, RWF_NOWAIT support in the block device matters.
But when the IO is being done through the filesystem it's far more
important to avoid blocking on filesystem locks that whatever the
block device does....

Hence I think that if the bio is coming from a filesystem,
REQ_NOWAIT should always be accepted or bounced with EAGAIN and
never failed with EOPNOTSUPP. It just makes no sense at all for
filesytsem based IO....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux