]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/api/Mirror: return EINVAL from image_get_mode()
authorRamana Raja <rraja@redhat.com>
Mon, 5 May 2025 17:31:34 +0000 (13:31 -0400)
committerRamana Raja <rraja@redhat.com>
Mon, 16 Jun 2025 16:54:26 +0000 (12:54 -0400)
commit479014e372a994813d8820e59f69479acc7ea06b
tree358e57baa1754041085b88db8593a13348dd2178
parent268966a364468c12b675c8bfae762931a3ea102d
librbd/api/Mirror: return EINVAL from image_get_mode()

... when the image is disabled for mirroring.

When an image is disabled for mirroring, fetching the image's
mirroring mode is invalid. So, modify the Mirror::image_get_mode()
internal API to return EINVAL instead of success when mirroring is
disabled.

The Mirror::image_get_mode() method is called by the public C++, C, and
Python APIs that fetch the mirroring mode of an image. The behavior of
these public APIs will change. They will return an error code or raise
an exception indicating that it's an invalid operation to fetch the
image's mirroring mode when mirroring is disabled.

Fixes: https://tracker.ceph.com/issues/71226
Signed-off-by: Ramana Raja <rraja@redhat.com>
PendingReleaseNotes
src/librbd/api/Mirror.cc
src/test/librbd/test_librbd.cc
src/test/librbd/test_mirroring.cc
src/test/pybind/test_rbd.py