On Wed, 05/04 12:10, Kevin Wolf wrote: > Am 19.04.2016 um 03:42 hat Fam Zheng geschrieben: > > Currently we only recurse to bs->file, which will miss the children in > > quorum > > and VMDK. > > > > Recurse into the whole subtree to avoid that. > > > > Signed-off-by: Fam Zheng <[email protected]> > > --- > > block.c | 20 ++++++++++++++------ > > 1 file changed, 14 insertions(+), 6 deletions(-) > > > > diff --git a/block.c b/block.c > > index d4939b4..fa8b38f 100644 > > --- a/block.c > > +++ b/block.c > > @@ -3201,6 +3201,7 @@ void bdrv_init_with_whitelist(void) > > > > void bdrv_invalidate_cache(BlockDriverState *bs, Error **errp) > > { > > + BdrvChild *child; > > Error *local_err = NULL; > > int ret; > > > > @@ -3215,13 +3216,20 @@ void bdrv_invalidate_cache(BlockDriverState *bs, > > Error **errp) > > > > if (bs->drv->bdrv_invalidate_cache) { > > bs->drv->bdrv_invalidate_cache(bs, &local_err); > > - } else if (bs->file) { > > - bdrv_invalidate_cache(bs->file->bs, &local_err); > > The old behaviour was that we only recurse for bs->file if the block > driver doesn't have its own implementation. > > This means that in qcow2, for example, we call bdrv_invalidate_cache() > explicitly for bs->file. If we can already invalidate it here, the call > inside qcow2 and probably other drivers could go away.
Yes, will update. Thanks. Fam
