qemu-block
[Top][All Lists]
Advanced

[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: Alberto Faria
Subject: Re: [PATCH v3 07/10] block: Implement bdrv_{pread, pwrite, pwrite_zeroes}() using generated_co_wrapper
Date: Thu, 26 May 2022 20:23:02 +0100

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]