]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librbd/mirror/PromoteRequest: return EINVAL
authorRamana Raja <rraja@redhat.com>
Mon, 5 May 2025 23:37:42 +0000 (19:37 -0400)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 23 Jun 2025 07:35:58 +0000 (09:35 +0200)
commitdeaed152e735f2591e80d1877ff53a12059e3c86
treea4d6b7a2d80e3ab8ca6021e4fd1ebc956f60da44
parente5269a6f2acd66b0637b0d1183fa06e314a53b21
librbd/mirror/PromoteRequest: return EINVAL

... instead of ENOENT when mirroring is not enabled for the image.

The PromoteRequest async state machine returns ENOENT when mirroring is
not enabled for the image. Instead, make it return EINVAL similar to
DemoteRequest's behavior, which is more appropriate. This also causes
the public facing C, C++, and Python APIs that promote an image
to return EINVAL or raise an equivalent exception when mirroring is
not enabled for the image.

Signed-off-by: Ramana Raja <rraja@redhat.com>
(cherry picked from commit eb19563c93f55757e9dabd050dfdd02233f33532)
PendingReleaseNotes
src/librbd/mirror/PromoteRequest.cc
src/test/librbd/test_mirroring.cc
src/test/pybind/test_rbd.py