Thanks for the feedback, and apologies for the delayed response. On Mon, May 30, 2022 at 1:49 PM Stefan Hajnoczi <stefa...@redhat.com> wrote: > If you find it's safe to change to -EINVAL then that's consistent with > how file I/O syscalls work and I think it would be nice.
Switching to -EINVAL on negative bytes sounds good to me, but perhaps it should be done as a separate series. For now, switching just bdrv_{pread,pwrite}() to -EIO will make them consistent with all of bdrv_{preadv,pwritev}() and bdrv_co_{pread,pwrite,preadv,pwritev}(), accomplishing the purpose of this series with less changes and auditing. I can work on a subsequent series that changes -EIO to -EINVAL on negative bytes for all the bdrv_...() and blk_...() functions. Would this make sense? Alberto