From 00e033275f39d8f0f47f28a2fb0f9bd80bde27bd Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 22 Sep 2011 21:22:03 -0700 Subject: [PATCH] rgw: generate tag if doesn't exist --- src/rgw/rgw_rados.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index a8fce97cf44ae..c1c9d0a605db4 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -760,8 +760,11 @@ int RGWRados::delete_obj_impl(void *ctx, std::string& id, rgw_obj& obj, bool syn string tag; op.remove(); if (sync) { - if (state->obj_tag.length()) + if (state->obj_tag.length()) { tag = state->obj_tag.c_str(); + } else { + append_rand_alpha(tag, tag, 32); + } int ret = cls_obj_prepare_op(bucket, CLS_RGW_OP_ADD, tag, oid); if (ret < 0) return ret; @@ -1319,8 +1322,11 @@ int RGWRados::clone_objs_impl(void *ctx, rgw_obj& dst_obj, bufferlist outbl; string tag; - if (state->obj_tag.length()) + if (state->obj_tag.length()) { tag = state->obj_tag.c_str(); + } else { + append_rand_alpha(tag, tag, 32); + } int ret = cls_obj_prepare_op(bucket, CLS_RGW_OP_ADD, tag, dst_oid); if (ret < 0) goto done; -- 2.39.5