summaryrefslogtreecommitdiff
path: root/src/cls_rgw.cc
diff options
context:
space:
mode:
authorGreg Farnum <gregory.farnum@dreamhost.com>2011-10-17 09:02:05 -0700
committerGreg Farnum <gregory.farnum@dreamhost.com>2011-10-19 17:46:01 -0700
commit952ebbaea2ac57f65c2084ef916e39c2d4f41fcf (patch)
tree226ae8e9e7a74afe9328d9d264d102639ea7a2a3 /src/cls_rgw.cc
parent9496732d5a9d03133622a888f0129770862c24ea (diff)
downloadceph-952ebbaea2ac57f65c2084ef916e39c2d4f41fcf.tar.gz
cls_rgw: add constructors to data structs; don't leak tags on races
We were leaking tags on races before, since we cut out of the function before clearing the tag. We don't do that any more. Also, we now use a constructor for the dir entry structs so that we don't follow the wrong paths (based on random memory) for brand new objects. Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
Diffstat (limited to 'src/cls_rgw.cc')
-rw-r--r--src/cls_rgw.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/cls_rgw.cc b/src/cls_rgw.cc
index f1252a31188..3135f1e8e23 100644
--- a/src/cls_rgw.cc
+++ b/src/cls_rgw.cc
@@ -214,10 +214,7 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
bufferlist::iterator cur_iter = current_entry.begin();
::decode(entry, cur_iter);
CLS_LOG("rgw_bucket_complete_op(): existing entry: epoch=%lld\n", entry.epoch);
- if (op.epoch <= entry.epoch) {
- CLS_LOG("rgw_bucket_complete_op(): skipping request, old epoch\n");
- return 0;
- }
+
if (entry.exists) {
struct rgw_bucket_category_stats& stats = header.stats[entry.meta.category];
stats.num_entries--;
@@ -235,6 +232,11 @@ int rgw_bucket_complete_op(cls_method_context_t hctx, bufferlist *in, bufferlist
entry.pending_map.erase(pinter);
}
+ if (op.epoch <= entry.epoch) {
+ CLS_LOG("rgw_bucket_complete_op(): skipping request, old epoch\n");
+ return 0;
+ }
+
bufferlist op_bl;
switch (op.op) {