Skip to content

Commit

Permalink
rgw: fix rewrite a versioning object create a new object bug
Browse files Browse the repository at this point in the history
Fixes: http://tracker.ceph.com/issues/21984

Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
  • Loading branch information
ZVampirEM77 committed Dec 1, 2017
1 parent 4898c36 commit 700a029
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/rgw/rgw_rados.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7445,7 +7445,9 @@ int RGWRados::rewrite_obj(RGWBucketInfo& dest_bucket_info, rgw_obj& obj)
attrset.erase(RGW_ATTR_TAIL_TAG);

return copy_obj_data(rctx, dest_bucket_info, read_op, obj_size - 1, obj, NULL, mtime, attrset,
0, real_time(), NULL, NULL);
0, real_time(),
(obj.key.instance.empty() ? NULL : &(obj.key.instance)),
NULL);
}

struct obj_time_weight {
Expand Down Expand Up @@ -8232,7 +8234,7 @@ int RGWRados::copy_obj_data(RGWObjectCtx& obj_ctx,
append_rand_alpha(cct, tag, tag, 32);

RGWPutObjProcessor_Atomic processor(obj_ctx,
dest_bucket_info, dest_obj.bucket, dest_obj.get_oid(),
dest_bucket_info, dest_obj.bucket, dest_obj.key.name,
cct->_conf->rgw_obj_stripe_size, tag, dest_bucket_info.versioning_enabled());
if (version_id) {
processor.set_version_id(*version_id);
Expand Down

0 comments on commit 700a029

Please sign in to comment.