From 45f5874e65a9e2fe91e3144e8d44d07a70d39abd Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 2 Dec 2020 13:02:30 +0000 Subject: [PATCH] librbd: skip fast-diff optimization when deep copying with flatten Even if a source object does not exist we still may need to copy from the source parent. Signed-off-by: Mykola Golub (cherry picked from commit 816680174db18ef5d1fe87c5c3451821d9b6def8) --- src/librbd/deep_copy/ImageCopyRequest.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/librbd/deep_copy/ImageCopyRequest.cc b/src/librbd/deep_copy/ImageCopyRequest.cc index 87eda9385bf0a..17aaa533efa4b 100644 --- a/src/librbd/deep_copy/ImageCopyRequest.cc +++ b/src/librbd/deep_copy/ImageCopyRequest.cc @@ -92,6 +92,11 @@ void ImageCopyRequest::map_src_objects(uint64_t dst_object, template void ImageCopyRequest::compute_diff() { + if (m_flatten) { + send_object_copies(); + return; + } + ldout(m_cct, 10) << dendl; auto ctx = create_context_callback< -- 2.47.3