File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -5984,14 +5984,16 @@ void RGWCopyObj::execute(optional_yield y)
59845984 if (op_ret < 0 ) {
59855985 return ;
59865986 }
5987+ obj_size = s->src_object ->get_size ();
59875988
59885989 /* Check if the src object is cloud-tiered */
59895990 bufferlist bl;
59905991 if (s->src_object ->get_attr (RGW_ATTR_MANIFEST, bl)) {
59915992 RGWObjManifest m;
59925993 try {
59935994 decode (m, bl);
5994- if (m.is_tier_type_s3 ()) {
5995+ // if object size is zero, then it transitioned object
5996+ if (m.is_tier_type_s3 () && (obj_size == 0 )) {
59955997 op_ret = -ERR_INVALID_OBJECT_STATE;
59965998 s->err .message = " This object was transitioned to cloud-s3" ;
59975999 ldpp_dout (this , 4 ) << " Cannot copy cloud tiered object. Failing with "
@@ -6006,8 +6008,7 @@ void RGWCopyObj::execute(optional_yield y)
60066008 }
60076009 }
60086010
6009- obj_size = s->src_object ->get_size ();
6010-
6011+
60116012 if (!s->system_request ) { // no quota enforcement for system requests
60126013 if (s->src_object ->get_accounted_size () > static_cast <size_t >(s->cct ->_conf ->rgw_max_put_size )) {
60136014 op_ret = -ERR_TOO_LARGE;
You can’t perform that action at this time.
0 commit comments