]> 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)
committerRamana Raja <rraja@redhat.com>
Mon, 16 Jun 2025 17:09:08 +0000 (13:09 -0400)
commiteb19563c93f55757e9dabd050dfdd02233f33532
treeb4332485389cb68002fcbaa90a0d893313a216f4
parent479014e372a994813d8820e59f69479acc7ea06b
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>
PendingReleaseNotes
src/librbd/mirror/PromoteRequest.cc
src/test/librbd/test_mirroring.cc
src/test/pybind/test_rbd.py