On Fri, 11/06 19:36, Max Reitz wrote: > > + next_sector = sector_num; > > + next_chunk = sector_num / sectors_per_chunk; > > @next_sector and @next_chunk set here... > > > hbitmap_next_sector = s->sector_num; > > - sector_num = s->sector_num; > > - sectors_per_chunk = s->granularity >> BDRV_SECTOR_BITS; > > - end = s->bdev_length / BDRV_SECTOR_SIZE; > > > > /* Extend the QEMUIOVector to include all adjacent blocks that will > > * be copied in this operation. > > @@ -198,14 +191,6 @@ static uint64_t coroutine_fn > > mirror_iteration(MirrorBlockJob *s) > > next_sector = sector_num; > > next_chunk = sector_num / sectors_per_chunk; > > ...and here already. So the above seems superfluous, considering that > they are not read in between. > > (If you keep hbitmap_next_sector = s->sector_num; above the sector_num = > ... block, that may reduce conflicts further)
Indeed, thanks for noticing this. > > + case MIRROR_METHOD_DISCARD: > > + return mirror_do_zero_or_discard(s, sector_num, > > + contiguous_sectors, > > + false); > > s/false/true/? Yes, thanks. Fam