From 690482d611c9785df964afc2da9fde63d510bd56 Mon Sep 17 00:00:00 2001 From: Tianshan Qu Date: Sun, 11 Feb 2018 16:38:21 +0800 Subject: [PATCH] rgw: fix index cancel op miss update header Signed-off-by: Tianshan Qu --- src/cls/rgw/cls_rgw.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/cls/rgw/cls_rgw.cc b/src/cls/rgw/cls_rgw.cc index 530edfbec93..f8d758dd6f4 100644 --- a/src/cls/rgw/cls_rgw.cc +++ b/src/cls/rgw/cls_rgw.cc @@ -854,10 +854,15 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist if (op.tag.size()) { bufferlist new_key_bl; encode(entry, new_key_bl); - return cls_cxx_map_set_val(hctx, idx, &new_key_bl); - } else { - return 0; + rc = cls_cxx_map_set_val(hctx, idx, &new_key_bl); + if (rc < 0) + return rc; } + + if (op.log_op && !header.syncstopped) { + return write_bucket_header(hctx, &header); + } + return 0; } if (entry.exists) {