[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}(
From: |
Eric Blake |
Subject: |
Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper |
Date: |
Fri, 27 May 2022 09:25:06 -0500 |
User-agent: |
NeoMutt/20220429-77-e284d5 |
On Thu, May 26, 2022 at 08:23:02PM +0100, Alberto Faria wrote:
> On Thu, May 26, 2022 at 9:55 AM Stefan Hajnoczi <stefanha@redhat.com> 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 overlooked something isn't
> exactly low, but it seems callers either cannot pass in negative
> values or don't care about the particular error code returned.
>
> Another option is to make bdrv_co_pread() and bdrv_co_pwrite() (which
> have much fewer callers) fail with -EINVAL when bytes is negative, but
> perhaps just getting rid of this final inconsistency between
> bdrv_[co_]{pread,pwrite}[v]() now will be worth it in the long run.
Failing with -EINVAL for negative bytes makes more sense at
identifying a programming error (whereas EIO tends to mean hardware
failure), so making that sort of cleanup seems reasonable.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- Re: [PATCH v3 01/10] block: Add a 'flags' param to bdrv_{pread,pwrite,pwrite_sync}(), (continued)
- [PATCH v3 05/10] block: Make bdrv_co_pwrite() take a const buffer, Alberto Faria, 2022/05/19
- [PATCH v3 03/10] block: Make bdrv_{pread, pwrite}() return 0 on success, Alberto Faria, 2022/05/19
- [PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper, Alberto Faria, 2022/05/19
- Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper, Stefan Hajnoczi, 2022/05/26
- Re: [PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper, Alberto Faria, 2022/05/26
- Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper,
Eric Blake <=
- Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper, Stefan Hajnoczi, 2022/05/30
- Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper, Stefan Hajnoczi, 2022/05/30
- Re: [PATCH v3 07/10] block: Implement bdrv_{pread,pwrite,pwrite_zeroes}() using generated_co_wrapper, Stefan Hajnoczi, 2022/05/30
[PATCH v3 06/10] block: Make 'bytes' param of bdrv_co_{pread, pwrite, preadv, pwritev}() an int64_t, Alberto Faria, 2022/05/19
- Re: [PATCH v3 06/10] block: Make 'bytes' param of bdrv_co_{pread,pwrite,preadv,pwritev}() an int64_t, Eric Blake, 2022/05/24
- Re: [PATCH v3 06/10] block: Make 'bytes' param of bdrv_co_{pread,pwrite,preadv,pwritev}() an int64_t, Stefan Hajnoczi, 2022/05/26
- Re: [PATCH v3 06/10] block: Make 'bytes' param of bdrv_co_{pread, pwrite, preadv, pwritev}() an int64_t, Alberto Faria, 2022/05/26
- Re: [PATCH v3 06/10] block: Make 'bytes' param of bdrv_co_{pread,pwrite,preadv,pwritev}() an int64_t, Eric Blake, 2022/05/27
[PATCH v3 08/10] block: Add bdrv_co_pwrite_sync(), Alberto Faria, 2022/05/19