]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cls_rgw: update bucket index when deleting object (with pending)
authorYehuda Sadeh <yehuda.sadeh@dreamhost.com>
Wed, 1 Feb 2012 20:55:52 +0000 (12:55 -0800)
committerYehuda Sadeh <yehuda.sadeh@dreamhost.com>
Wed, 1 Feb 2012 20:58:56 +0000 (12:58 -0800)
Bug #2012. Racing delete with other operations (update or another
delete) failed to update the bucket index.

Signed-off-by: Yehuda Sadeh <yehuda.sadeh@dreamhost.com>
src/cls_rgw.cc

index 7e5f4de619d297a15d78df1557b8feabedc5305c..a6b3e736693ccda2b59d161fb04c9759985941fe 100644 (file)
@@ -248,8 +248,14 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
       if (!entry.pending_map.size()) {
         op_bl.append(CEPH_OSD_TMAP_RM);
         ::encode(op.name, op_bl);
-      } else
+      } else {
         entry.exists = false;
+        bufferlist new_key_bl;
+        ::encode(entry, new_key_bl);
+        op_bl.append(CEPH_OSD_TMAP_SET);
+        ::encode(op.name, op_bl);
+        ::encode(new_key_bl, op_bl);
+      }
     } else {
       return -ENOENT;
     }