Re: [PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper

2022-06-09 Thread Alberto Faria
On Wed, Jun 8, 2022 at 1:50 PM Stefan Hajnoczi wrote: > 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

Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-06-08 Thread Stefan Hajnoczi
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 wrote: > > If you find it's safe to change to -EINVAL then that's consistent with > > how file I/O syscalls work

Re: [PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper

2022-06-06 Thread Alberto Faria
Thanks for the feedback, and apologies for the delayed response. On Mon, May 30, 2022 at 1:49 PM Stefan Hajnoczi 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

Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-05-30 Thread Stefan Hajnoczi
For completeness, a few more lines from IRC: 13:56 < hreitz> Errr s/E2BIG/ENOSPC/ 13:57 < kwolf> Anthony added it like this in 71d0770c4ce, and then we only had extensions and refactorings 13:58 < kwolf> Yes, ENOSPC actually has a different meaning because of the werror/rerror stuff 13:58 <

Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-05-30 Thread Stefan Hajnoczi
On Fri, May 27, 2022 at 09:25:06AM -0500, Eric Blake wrote: > On Thu, May 26, 2022 at 08:23:02PM +0100, Alberto Faria wrote: > > On Thu, May 26, 2022 at 9:55 AM Stefan Hajnoczi wrote: > > > The bdrv_pread()/bdrv_pwrite() errno for negative bytes changes from > > > EINVAL to EIO. Did you audit the

Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-05-30 Thread Stefan Hajnoczi
On Fri, May 27, 2022 at 09:25:06AM -0500, Eric Blake wrote: > On Thu, May 26, 2022 at 08:23:02PM +0100, Alberto Faria wrote: > > On Thu, May 26, 2022 at 9:55 AM Stefan Hajnoczi wrote: > > > The bdrv_pread()/bdrv_pwrite() errno for negative bytes changes from > > > EINVAL to EIO. Did you audit the

Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-05-27 Thread Eric Blake
On Thu, May 26, 2022 at 08:23:02PM +0100, Alberto Faria wrote: > On Thu, May 26, 2022 at 9:55 AM Stefan Hajnoczi wrote: > > The bdrv_pread()/bdrv_pwrite() errno for negative bytes changes from > > EINVAL to EIO. Did you audit the code to see if it matters? > > I don't believe I had, but I

Re: [PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper

2022-05-26 Thread Alberto Faria
On Thu, May 26, 2022 at 9:55 AM Stefan Hajnoczi wrote: > The bdrv_pread()/bdrv_pwrite() errno for negative bytes changes from > EINVAL to EIO. Did you audit the code to see if it matters? I don't believe I had, but I checked all calls now. There's ~140 of them, so the probability of me having

Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper

2022-05-26 Thread Stefan Hajnoczi
On Thu, May 19, 2022 at 03:48:37PM +0100, Alberto Faria wrote: > bdrv_pwrite_zeroes() now also calls trace_bdrv_co_pwrite_zeroes() and > clears the BDRV_REQ_MAY_UNMAP flag when appropriate, which it didn't > previously. The bdrv_pread()/bdrv_pwrite() errno for negative bytes changes from EINVAL

[PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper

2022-05-19 Thread Alberto Faria
bdrv_pwrite_zeroes() now also calls trace_bdrv_co_pwrite_zeroes() and clears the BDRV_REQ_MAY_UNMAP flag when appropriate, which it didn't previously. Signed-off-by: Alberto Faria Reviewed-by: Paolo Bonzini --- block/io.c | 41