]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
rbd: remove snapshot existence validation code
authorIlya Dryomov <idryomov@gmail.com>
Mon, 18 Nov 2019 11:51:02 +0000 (12:51 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 25 Nov 2019 10:44:03 +0000 (11:44 +0100)
commit686238b7431dcca870ff0bc8ae280cdc89ee41c7
treebf080481c35be98f9d4f38c23a998c16f3d3ffc3
parentb9ef2b8858a0cf07d5f1b201abaf2480f4aa8201
rbd: remove snapshot existence validation code

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: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>
Reviewed-by: Dongsheng Yang <dongsheng.yang@easystack.cn>
drivers/block/rbd.c