Skip to content
  • Kevin Wolf's avatar
    de4fed6f
    qcow2: Mark qcow2_inactivate() and callers GRAPH_RDLOCK · de4fed6f
    Kevin Wolf authored
    
    
    This adds GRAPH_RDLOCK annotations to declare that callers of
    qcow2_inactivate() need to hold a reader lock for the graph because it
    calls bdrv_get_device_or_node_name(), which accesses the parents list of
    a node.
    
    qcow2_do_close() is a bit strange because it is called from different
    contexts. If close_data_file = true, we know that we were called from
    non-coroutine main loop context (more specifically, we're coming from
    qcow2_close()) and can safely drop the reader lock temporarily with
    bdrv_graph_rdunlock_main_loop() and acquire the writer lock.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-ID: <20230929145157.45443-16-kwolf@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    de4fed6f
    qcow2: Mark qcow2_inactivate() and callers GRAPH_RDLOCK
    Kevin Wolf authored
    
    
    This adds GRAPH_RDLOCK annotations to declare that callers of
    qcow2_inactivate() need to hold a reader lock for the graph because it
    calls bdrv_get_device_or_node_name(), which accesses the parents list of
    a node.
    
    qcow2_do_close() is a bit strange because it is called from different
    contexts. If close_data_file = true, we know that we were called from
    non-coroutine main loop context (more specifically, we're coming from
    qcow2_close()) and can safely drop the reader lock temporarily with
    bdrv_graph_rdunlock_main_loop() and acquire the writer lock.
    
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
    Message-ID: <20230929145157.45443-16-kwolf@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
Loading