qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH for-2.9 1/5] block: Fix unpaired aio_disable_ext


From: Fam Zheng
Subject: Re: [Qemu-block] [PATCH for-2.9 1/5] block: Fix unpaired aio_disable_external in external snapshot
Date: Fri, 7 Apr 2017 07:38:56 +0800
User-agent: Mutt/1.8.0 (2017-02-23)

On Thu, 04/06 16:36, Kevin Wolf wrote:
> Am 06.04.2017 um 16:25 hat Fam Zheng geschrieben:
> > bdrv_replace_child_noperm tries to hand over the quiesce_counter state
> > from old bs to the new one, but if they are not on the same aio context
> > this causes unbalance.
> > 
> > Fix this by forcing callers to move the aio context first, and assert
> > it.
> > 
> > Reported-by: Ed Swierk <address@hidden>
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
> >  block.c    | 3 +++
> >  blockdev.c | 4 ++--
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/block.c b/block.c
> > index 927ba89..8893ac1 100644
> > --- a/block.c
> > +++ b/block.c
> > @@ -1752,6 +1752,9 @@ static void bdrv_replace_child_noperm(BdrvChild 
> > *child,
> >  {
> >      BlockDriverState *old_bs = child->bs;
> >  
> > +    if (old_bs && new_bs) {
> > +        assert(bdrv_get_aio_context(old_bs) == 
> > bdrv_get_aio_context(new_bs));
> > +    }
> >      if (old_bs) {
> >          if (old_bs->quiesce_counter && child->role->drained_end) {
> >              child->role->drained_end(child);
> 
> Can we move this to a separate patch and also add this hunk for
> asserting the same thing for newly attached child nodes:
> 
> @@ -1852,6 +1855,7 @@ BdrvChild *bdrv_attach_child(BlockDriverState 
> *parent_bs,
>      bdrv_get_cumulative_perm(parent_bs, &perm, &shared_perm);
>  
>      assert(parent_bs->drv);
> +    assert(bdrv_get_aio_context(parent_bs) == 
> bdrv_get_aio_context(child_bs));
>      parent_bs->drv->bdrv_child_perm(parent_bs, NULL, child_role,
>                                      perm, shared_perm, &perm, &shared_perm);

OK, will do.



reply via email to

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