• Alex Elder's avatar
    rbd: re-submit read request for flattened clone · 02c74fba
    Alex Elder authored
    If a clone image gets flattened while a parent read request is
    underway, the original rbd object request needs to be resubmitted.
    
    The reason is that by the time we get the response to the parent
    read request, the data read from the parent may be out of date.
    In other words, we could see this sequence of events:
    
        rbd client                      parent image/osd
        ----------                      ----------------
        original object ENOENT;
            issue parent read
                                        respond to parent read
                                        child image flattened
        original image header refresh
                 <--- original object written independently here
        parent read response received
    
    Add code to rbd_img_parent_read_callback() to detect when a clone's
    parent image has disappeared (as evidenced by its parent overlap
    becoming 0), and re-submit the original read request in that case.
    Signed-off-by: default avatarAlex Elder <elder@inktank.com>
    Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
    02c74fba
rbd.c 134 KB