]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix index cancel op miss update header 20396/head
authorTianshan Qu <tianshan@xsky.com>
Sun, 11 Feb 2018 08:38:21 +0000 (16:38 +0800)
committerTianshan Qu <tianshan@xsky.com>
Wed, 14 Feb 2018 08:43:27 +0000 (16:43 +0800)
Signed-off-by: Tianshan Qu <tianshan@xsky.com>
src/cls/rgw/cls_rgw.cc

index 530edfbec93b9aff29c2e4ec1ea49f7da2b058bd..f8d758dd6f4b201412942d545b5666327f39edcf 100644 (file)
@@ -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) {