On Fri, Oct 11, 2019 at 11:04:12AM -0700, Darrick J. Wong wrote: > On Fri, Oct 11, 2019 at 06:31:27PM +0200, Jan Kara wrote: > > On Fri 11-10-19 08:28:21, Darrick J. Wong wrote: > > > On Fri, Oct 11, 2019 at 04:14:31PM +0200, Jan Kara wrote: > > > > Filesystems do not support doing IO as asynchronous in some cases. For > > > > example in case of unaligned writes or in case file size needs to be > > > > extended (e.g. for ext4). Instead of forcing filesystem to wait for AIO > > > > in such cases, add argument to iomap_dio_rw() which makes the function > > > > wait for IO completion. This also results in executing > > > > iomap_dio_complete() inline in iomap_dio_rw() providing its return value > > > > to the caller as for ordinary sync IO. > > > > > > > > Signed-off-by: Jan Kara <jack@xxxxxxx> > > > > ... > > > > > > @@ -409,6 +409,9 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, > > > > if (!count) > > > > return 0; > > > > > > > > + if (WARN_ON(is_sync_kiocb(iocb) && !wait_for_completion)) > > > > + return -EINVAL; > > > > > > So far in iomap we've been returning EIO when someone internal screws > > > up, which (AFAICT) is the case here. > > > > Yes. Should I resend with -EIO or will you tweak that on commit? > > Yes, please. :) "Yes, resend the patch with -EIO, please." :/ --D > > --D > > > Honza > > -- > > Jan Kara <jack@xxxxxxxx> > > SUSE Labs, CR