Skip to content

Commit

Permalink
Merge pull request #18369 from baixueyu/refcount_bug
Browse files Browse the repository at this point in the history
 rgw: source data in 'default.rgw.buckets.data' may not be deleted after inter-bucket copy
  • Loading branch information
mattbenjamin committed Oct 25, 2017
2 parents 410594a + 2e11545 commit d1fdc23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rgw/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8078,9 +8078,11 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx,
if (tail_placement.bucket.name.empty()) {
manifest.set_tail_placement(tail_placement.placement_rule, src_obj.bucket);
}
string ref_tag;
for (; miter != astate->manifest.obj_end(); ++miter) {
ObjectWriteOperation op;
cls_refcount_get(op, tag, true);
ref_tag = tag + '\0';
cls_refcount_get(op, ref_tag, true);
const rgw_raw_obj& loc = miter.get_location().get_raw_obj(this);
ref.ioctx.locator_set_key(loc.loc);

Expand Down Expand Up @@ -9664,7 +9666,6 @@ int RGWRados::set_attrs(void *ctx, const RGWBucketInfo& bucket_info, rgw_obj& ob
return r;

bl.append(tag.c_str(), tag.size() + 1);

op.setxattr(RGW_ATTR_ID_TAG, bl);
}

Expand Down

0 comments on commit d1fdc23

Please sign in to comment.