On Mon, Jun 06, 2022 at 05:10:38PM +0100, Alberto Faria wrote: > 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?
Yes, that's fine. My main concern is that callers have been audited when errnos are changed. If you switch bdrv_{pread,pwrite}() to -EIO and have audited callers, then I'm happy. Consistent -EINVAL would be nice in the future, but I think it's lower priority and it doesn't have to be done any time soon. Stefan
signature.asc
Description: PGP signature