]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: corrected error code from image_snapshot_create API
authorJason Dillaman <dillaman@redhat.com>
Wed, 5 Feb 2020 14:27:30 +0000 (09:27 -0500)
committerJason Dillaman <dillaman@redhat.com>
Mon, 10 Feb 2020 13:37:14 +0000 (08:37 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/librbd/api/Mirror.cc

index 88e3bf80e663a6ba57d8ce2024bf07de061238fe..56aa2cdb8d165b3feea87c39cb0f7eeb75791468 100644 (file)
@@ -1860,7 +1860,7 @@ int Mirror<I>::image_snapshot_create(I *ictx, uint64_t *snap_id) {
   if (mirror_image.mode != cls::rbd::MIRROR_IMAGE_MODE_SNAPSHOT ||
       mirror_image.state != cls::rbd::MIRROR_IMAGE_STATE_ENABLED) {
     lderr(cct) << "snapshot based mirroring is not enabled" << dendl;
-    return r;
+    return -EINVAL;
   }
 
   C_SaferCond on_finish;