From 38014a20c04fd735571e1a06de926ea614a2f2a6 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Tue, 12 May 2020 10:16:36 -0400 Subject: [PATCH] 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 (cherry picked from commit 69b6d5997e8c6a11739e4d5a32564e61eb2f470f) Conflicts: src/librbd/internal.cc - in nautilus, the call immediately preceding the change is "src->snap_lock.put_read()" whereas in master it is "src->image_lock.unlock_shared()" --- src/librbd/internal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librbd/internal.cc b/src/librbd/internal.cc index 89b538d6e644..ebf2603f3f35 100644 --- a/src/librbd/internal.cc +++ b/src/librbd/internal.cc @@ -1345,7 +1345,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->snap_lock.put_read(); - 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); } -- 2.47.3