Skip to content

Commit

Permalink
librbd: make rename request complete with filtered code
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/23068
Signed-off-by: Mykola Golub <mgolub@suse.com>
(cherry picked from commit 9d6fc30)
  • Loading branch information
trociny authored and Prashant D committed Feb 28, 2018
1 parent ba2e120 commit 286fa7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/librbd/operation/RenameRequest.cc
Expand Up @@ -64,7 +64,7 @@ bool RenameRequest<I>::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;
Expand Down Expand Up @@ -100,7 +100,7 @@ bool RenameRequest<I>::should_complete(int r) {
}

template <typename I>
int RenameRequest<I>::filter_state_return_code(int r) {
int RenameRequest<I>::filter_return_code(int r) const {
I &image_ctx = this->m_image_ctx;
CephContext *cct = image_ctx.cct;

Expand Down
3 changes: 1 addition & 2 deletions src/librbd/operation/RenameRequest.h
Expand Up @@ -57,6 +57,7 @@ class RenameRequest : public Request<ImageCtxT>
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);
Expand All @@ -72,8 +73,6 @@ class RenameRequest : public Request<ImageCtxT>

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();
Expand Down

0 comments on commit 286fa7a

Please sign in to comment.