]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: snap_get_limit compatibility check 11766/head
authorMykola Golub <mgolub@mirantis.com>
Thu, 3 Nov 2016 14:05:23 +0000 (16:05 +0200)
committerMykola Golub <mgolub@mirantis.com>
Thu, 3 Nov 2016 16:36:04 +0000 (18:36 +0200)
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/librbd/internal.cc

index 13dc586c4dc6ba67ac259adc5126f3424c71be38..21188895c2770964debe0a017f5e2e3fdfc6837d 100644 (file)
@@ -1774,8 +1774,13 @@ int mirror_image_disable_internal(ImageCtx *ictx, bool force,
 
   int snap_get_limit(ImageCtx *ictx, uint64_t *limit)
   {
-    return cls_client::snapshot_get_limit(&ictx->md_ctx, ictx->header_oid,
-                                         limit);
+    int r = cls_client::snapshot_get_limit(&ictx->md_ctx, ictx->header_oid,
+                                           limit);
+    if (r == -EOPNOTSUPP) {
+      *limit = UINT64_MAX;
+      r = 0;
+    }
+    return r;
   }
 
   int snap_set_limit(ImageCtx *ictx, uint64_t limit)