Re: [PATCH] block/io: fix bdrv_co_do_copy_on_readv

2020-03-16 Thread Stefan Hajnoczi
On Thu, Mar 12, 2020 at 11:19:49AM +0300, Vladimir Sementsov-Ogievskiy wrote: > Prior to 1143ec5ebf4 it was OK to qemu_iovec_from_buf() from aligned-up > buffer to original qiov, as qemu_iovec_from_buf() will stop at qiov end > anyway. > > But after 1143ec5ebf4 we assume that

Re: [PATCH] block/io: fix bdrv_co_do_copy_on_readv

2020-03-13 Thread Vladimir Sementsov-Ogievskiy
13.03.2020 2:09, John Snow wrote: On 3/12/20 4:19 AM, Vladimir Sementsov-Ogievskiy wrote: Prior to 1143ec5ebf4 it was OK to qemu_iovec_from_buf() from aligned-up buffer to original qiov, as qemu_iovec_from_buf() will stop at qiov end anyway. But after 1143ec5ebf4 we assume that

Re: [PATCH] block/io: fix bdrv_co_do_copy_on_readv

2020-03-12 Thread John Snow
On 3/12/20 4:19 AM, Vladimir Sementsov-Ogievskiy wrote: > Prior to 1143ec5ebf4 it was OK to qemu_iovec_from_buf() from aligned-up > buffer to original qiov, as qemu_iovec_from_buf() will stop at qiov end > anyway. > > But after 1143ec5ebf4 we assume that bdrv_co_do_copy_on_readv works on >

[PATCH] block/io: fix bdrv_co_do_copy_on_readv

2020-03-12 Thread Vladimir Sementsov-Ogievskiy
Prior to 1143ec5ebf4 it was OK to qemu_iovec_from_buf() from aligned-up buffer to original qiov, as qemu_iovec_from_buf() will stop at qiov end anyway. But after 1143ec5ebf4 we assume that bdrv_co_do_copy_on_readv works on part of original qiov, defined by qiov_offset and bytes. So we must not

Re: [Qemu-devel] [PATCH] block/io: fix bdrv_co_do_copy_on_readv error handling

2019-03-14 Thread Vladimir Sementsov-Ogievskiy
14.03.2019 13:14, Vladimir Sementsov-Ogievskiy wrote: > It's not safe to treat bdrv_is_allocated error as unallocated: if we > mistake we may rewrite guest data. ... with same data, which is not so bad. So, it's ok, I'm wrong, drop it. > > Signed-off-by: Vladimir Sementsov-Ogievskiy > --- >

[Qemu-devel] [PATCH] block/io: fix bdrv_co_do_copy_on_readv error handling

2019-03-14 Thread Vladimir Sementsov-Ogievskiy
It's not safe to treat bdrv_is_allocated error as unallocated: if we mistake we may rewrite guest data. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/io.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/block/io.c b/block/io.c index