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>
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--;
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) {
string owner_display_name;
string tag;
+ rgw_bucket_dir_entry_meta() :
+ category(0), size(0) { mtime.set_from_double(0); }
+
void encode(bufferlist &bl) const {
__u8 struct_v = 1;
::encode(struct_v, bl);
struct rgw_bucket_dir_entry_meta meta;
map<string, struct rgw_bucket_pending_info> pending_map;
+ rgw_bucket_dir_entry() :
+ epoch(0), exists(false) {}
+
void encode(bufferlist &bl) const {
__u8 struct_v = 1;
::encode(struct_v, bl);