• Ilya Dryomov's avatar
    rbd: remove snapshot existence validation code · 686238b7
    Ilya Dryomov authored
    RBD_DEV_FLAG_EXISTS check in rbd_queue_workfn() is racy and leads to
    inconsistent behaviour.  If the object (or its snapshot) isn't there,
    the OSD returns ENOENT.  A read submitted before the snapshot removal
    notification is processed would be zero-filled and ended with status
    OK, while future reads would be failed with IOERR.  It also doesn't
    handle a case when an image that is mapped read-only is removed.
    
    On top of this, because watch is no longer established for read-only
    mappings, we no longer get notifications, so rbd_exists_validate() is
    effectively dead code.  While failing requests rather than returning
    zeros is a good thing, RBD_DEV_FLAG_EXISTS is not it.
    Signed-off-by: default avatarIlya Dryomov <idryomov@gmail.com>
    Reviewed-by: default avatarJason Dillaman <dillaman@redhat.com>
    Reviewed-by: default avatarDongsheng Yang <dongsheng.yang@easystack.cn>
    686238b7
rbd.c 184 KB