From 286fa7a29c3ce44b45ce63ece9d06dd39f2370d2 Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Wed, 21 Feb 2018 10:45:57 +0200 Subject: [PATCH] librbd: make rename request complete with filtered code Fixes: http://tracker.ceph.com/issues/23068 Signed-off-by: Mykola Golub (cherry picked from commit 9d6fc30e54f4c0ecfac4e9a907d818e1e7665b96) --- src/librbd/operation/RenameRequest.cc | 4 ++-- src/librbd/operation/RenameRequest.h | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/librbd/operation/RenameRequest.cc b/src/librbd/operation/RenameRequest.cc index 75630915598fc..04bfc492b7edf 100644 --- a/src/librbd/operation/RenameRequest.cc +++ b/src/librbd/operation/RenameRequest.cc @@ -64,7 +64,7 @@ bool RenameRequest::should_complete(int r) { CephContext *cct = image_ctx.cct; ldout(cct, 5) << this << " " << __func__ << ": state=" << m_state << ", " << "r=" << r << dendl; - r = filter_state_return_code(r); + r = filter_return_code(r); if (r < 0) { if (r == -EEXIST) { ldout(cct, 1) << "image already exists" << dendl; @@ -100,7 +100,7 @@ bool RenameRequest::should_complete(int r) { } template -int RenameRequest::filter_state_return_code(int r) { +int RenameRequest::filter_return_code(int r) const { I &image_ctx = this->m_image_ctx; CephContext *cct = image_ctx.cct; diff --git a/src/librbd/operation/RenameRequest.h b/src/librbd/operation/RenameRequest.h index b0aa5640971e5..209bec3238fa7 100644 --- a/src/librbd/operation/RenameRequest.h +++ b/src/librbd/operation/RenameRequest.h @@ -57,6 +57,7 @@ public: protected: void send_op() override; bool should_complete(int r) override; + int filter_return_code(int r) const override; journal::Event create_event(uint64_t op_tid) const override { return journal::RenameEvent(op_tid, m_dest_name); @@ -72,8 +73,6 @@ private: bufferlist m_header_bl; - int filter_state_return_code(int r); - void send_read_source_header(); void send_write_destination_header(); void send_update_directory(); -- 2.39.5