From: Ilya Dryomov Date: Mon, 16 Sep 2024 09:37:49 +0000 (+0200) Subject: librbd/crypto/LoadRequest: rename m_is_current_format_cloned X-Git-Tag: v20.0.0~888^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=63529523f5778294fa9e447604f9d18c091b6b12;p=ceph.git librbd/crypto/LoadRequest: rename m_is_current_format_cloned Formats must also be cloned if the image is under migration, so rename m_is_current_format_cloned to m_is_current_format_assumed to avoid potential confusion with clone() being called in two places but m_is_current_format_cloned being set in only one place. Signed-off-by: Ilya Dryomov --- diff --git a/src/librbd/crypto/LoadRequest.cc b/src/librbd/crypto/LoadRequest.cc index 5bc57d693c5d3..a751605e0d5ee 100644 --- a/src/librbd/crypto/LoadRequest.cc +++ b/src/librbd/crypto/LoadRequest.cc @@ -31,7 +31,7 @@ LoadRequest::LoadRequest( Context* on_finish) : m_image_ctx(image_ctx), m_on_finish(on_finish), m_format_idx(0), - m_is_current_format_cloned(false), + m_is_current_format_assumed(false), m_formats(std::move(formats)) { } @@ -108,7 +108,7 @@ void LoadRequest::handle_load(int r) { ldout(m_image_ctx->cct, 20) << "r=" << r << dendl; if (r < 0) { - if (m_is_current_format_cloned && + if (m_is_current_format_assumed && m_detected_format_name == UNKNOWN_FORMAT) { // encryption format was not detected, assume plaintext ldout(m_image_ctx->cct, 5) << "assuming plaintext for image " @@ -125,7 +125,7 @@ void LoadRequest::handle_load(int r) { } ldout(m_image_ctx->cct, 5) << "loaded format " << m_detected_format_name - << (m_is_current_format_cloned ? " (cloned)" : "") + << (m_is_current_format_assumed ? " (assumed)" : "") << " for image " << m_current_image_ctx->name << dendl; @@ -136,8 +136,8 @@ void LoadRequest::handle_load(int r) { if (m_format_idx >= m_formats.size()) { // try to load next ancestor using the same format ldout(m_image_ctx->cct, 20) << "cloning format" << dendl; - m_is_current_format_cloned = true; m_formats.push_back(m_formats[m_formats.size() - 1]->clone()); + m_is_current_format_assumed = true; } load(); diff --git a/src/librbd/crypto/LoadRequest.h b/src/librbd/crypto/LoadRequest.h index 84f595bb6c616..702748a24187d 100644 --- a/src/librbd/crypto/LoadRequest.h +++ b/src/librbd/crypto/LoadRequest.h @@ -44,7 +44,7 @@ private: Context* m_on_finish; size_t m_format_idx; - bool m_is_current_format_cloned; + bool m_is_current_format_assumed; std::vector m_formats; I* m_current_image_ctx; std::string m_detected_format_name;