• Ilya Dryomov's avatar
    rbd: quiescing lock should wait for image requests · e1fddc8f
    Ilya Dryomov authored
    Syncing OSD requests doesn't really work.  A single image request may
    be comprised of multiple object requests, each of which can go through
    a series of OSD requests (original, copyups, etc).  On top of that, the
    OSD cliest may be shared with other rbd devices.
    
    What we want is to ensure that all in-flight image requests complete.
    Introduce rbd_dev->running_list and block in RBD_LOCK_STATE_RELEASING
    until that happens.  New OSD requests may be started during this time.
    
    Note that __rbd_img_handle_request() acquires rbd_dev->lock_rwsem only
    if need_exclusive_lock() returns true.  This avoids a deadlock similar
    to the one outlined in the previous commit between unlock and I/O that
    doesn't require lock, such as a read with object-map feature disabled.
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    Reviewed-by: default avatarDongsheng Yang <dongsheng.yang@easystack.cn>
    e1fddc8f
rbd.c 165 KB