From: Mykola Golub Date: Wed, 21 Feb 2018 08:45:57 +0000 (+0200) Subject: librbd: make rename request complete with filtered code X-Git-Tag: v12.2.5~122^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=286fa7a29c3ce44b45ce63ece9d06dd39f2370d2;p=ceph.git 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) --- diff --git a/src/librbd/operation/RenameRequest.cc b/src/librbd/operation/RenameRequest.cc index 75630915598f..04bfc492b7ed 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 b0aa5640971e..209bec3238fa 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();