• Alex Elder's avatar
    rbd: get parent info on refresh · 642a2537
    Alex Elder authored
    Get parent info for format 2 images on every refresh (rather than
    just during the initial probe).  This will be needed to detect the
    disappearance of the parent image in the event a mapped image
    becomes unlayered (i.e., flattened).  Avoid leaking the previous
    parent spec on the second and subsequent times this information is
    requested by dropping the previous one (if any) before updating it.
    (Also, extract the pool id into a local variable before assigning
    it into the parent spec.)
    
    Switch to using a non-zero parent overlap value rather than the
    existence of a parent (a non-null parent_spec pointer) to determine
    whether to mark a request layered.  It will soon be possible for
    a layered image to become unlayered while a request is in flight.
    
    This means that the layered flag for an image request indicates that
    there was a non-zero parent overlap at the time the image request
    was created.  The parent overlap can change thereafter, which may
    lead to special handling at request submission or completion time.
    
    This and the next several patches are related to:
        http://tracker.ceph.com/issues/3763
    
    NOTE:
    If an error occurs while refreshing the parent info (i.e.,
    requesting it after initial probe), the old parent info will
    persist.  This is not really correct, and is a scenario that needs
    to be addressed.  For now we'll assert that the failure mode is
    unlikely, but the issue has been documented in tracker issue 5040.
    Signed-off-by: default avatarAlex Elder <elder@inktank.com>
    Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
    642a2537
rbd.c 129 KB