From: Jason Dillaman Date: Tue, 12 May 2020 14:16:36 +0000 (-0400) Subject: librbd: copy API should not inherit v1 image format by default X-Git-Tag: v16.1.0~2323^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F35025%2Fhead;p=ceph.git librbd: copy API should not inherit v1 image format by default When copying from a v1 image, by default the new destination image would be created using the v1 format. Since the creation of v1 images is disallowed, this has been updated to default to using the v2 image format. Fixes: https://tracker.ceph.com/issues/45518 Signed-off-by: Jason Dillaman --- diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index f4350c8ad27d..ba99a14bb21c 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1123,7 +1123,7 @@ int validate_pool(IoCtx &io_ctx, CephContext *cct) { uint64_t features = src->features; uint64_t src_size = src->get_image_size(src->snap_id); src->image_lock.unlock_shared(); - uint64_t format = src->old_format ? 1 : 2; + uint64_t format = 2; if (opts.get(RBD_IMAGE_OPTION_FORMAT, &format) != 0) { opts.set(RBD_IMAGE_OPTION_FORMAT, format); }