On Thu, Jan 27, 2022 at 8:36 PM Eric Blake <eblake(a)redhat.com> wrote:
On Thu, Jan 27, 2022 at 01:49:31AM +0200, Nir Soffer wrote:
> This example failed to check the *error parameter to the completion and
> extent callbacks.
>
> - If the source NBD server failed a read, we wrote stale data from the
> request buffer to the destination image, corrupting the
> image.
>
> - If the destination NBD server failed a write or zero command, we
> ignored the error, leaving previous content on the destination image,
> corrupting the image.
>
> - Error in the extents callbacks were ignored. I'm not sure if this was
> a real problem, but it is a very bad example.
>
> In all cases, the copy would end with zero exit code creating a
> corrupted image.
Oh well. This silent data corruption affects more than copy-libev.c;
Right, this issue should be fixed in nbdcopy, many examples, and
some tests. I started with this example since it was easier for me,
and I know you are working on nbdcopy fix.
Nir