Skip to content
Snippets Groups Projects
  • Kevin Wolf's avatar
    0152bf40
    block: Don't notify parents in drain call chain · 0152bf40
    Kevin Wolf authored
    
    This is in preparation for subtree drains, i.e. drained sections that
    affect not only a single node, but recursively all child nodes, too.
    
    Calling the parent callbacks for drain is pointless when we just came
    from that parent node recursively and leads to multiple increases of
    bs->quiesce_counter in a single drain call. Don't do it.
    
    In order for this to work correctly, the parent callback must be called
    for every bdrv_drain_begin/end() call, not only for the outermost one:
    
    If we have a node N with two parents A and B, recursive draining of A
    should cause the quiesce_counter of B to increase because its child N is
    drained independently of B. If now B is recursively drained, too, A must
    increase its quiesce_counter because N is drained independently of A
    only now, even if N is going from quiesce_counter 1 to 2.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    0152bf40
    History
    block: Don't notify parents in drain call chain
    Kevin Wolf authored
    
    This is in preparation for subtree drains, i.e. drained sections that
    affect not only a single node, but recursively all child nodes, too.
    
    Calling the parent callbacks for drain is pointless when we just came
    from that parent node recursively and leads to multiple increases of
    bs->quiesce_counter in a single drain call. Don't do it.
    
    In order for this to work correctly, the parent callback must be called
    for every bdrv_drain_begin/end() call, not only for the outermost one:
    
    If we have a node N with two parents A and B, recursive draining of A
    should cause the quiesce_counter of B to increase because its child N is
    drained independently of B. If now B is recursively drained, too, A must
    increase its quiesce_counter because N is drained independently of A
    only now, even if N is going from quiesce_counter 1 to 2.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>