]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: copy object add response error message 18291/head
authorEnming Zhang <enming.zhang@umcloud.com>
Fri, 13 Oct 2017 09:00:15 +0000 (17:00 +0800)
committerEnming Zhang <enming.zhang@umcloud.com>
Fri, 20 Oct 2017 12:20:24 +0000 (20:20 +0800)
Signed-off-by: Enming Zhang <enming.zhang@umcloud.com>
src/rgw/rgw_rest_s3.cc

index 3fc2b51adbef7829f33ff34cb92d0dd759b547ec..7d2ac9665c04dedc1af2c4010b054dd6d655c2b5 100644 (file)
@@ -2102,7 +2102,8 @@ int RGWCopyObj_ObjStore_S3::get_params()
     } else if (!source_zone.empty()) {
       attrs_mod = RGWRados::ATTRSMOD_NONE; // default for intra-zone_group copy
     } else {
-      ldout(s->cct, 0) << "invalid metadata directive" << dendl;
+      s->err.message = "Unknown metadata directive.";
+      ldout(s->cct, 0) << s->err.message << dendl;
       return -EINVAL;
     }
   }
@@ -2114,8 +2115,10 @@ int RGWCopyObj_ObjStore_S3::get_params()
       src_object.instance.empty() &&
       (attrs_mod != RGWRados::ATTRSMOD_REPLACE)) {
     /* can only copy object into itself if replacing attrs */
-    ldout(s->cct, 0) << "can't copy object into itself if not replacing attrs"
-                    << dendl;
+    s->err.message = "This copy request is illegal because it is trying to copy "
+                     "an object to itself without changing the object's metadata, "
+                     "storage class, website redirect location or encryption attributes.";
+    ldout(s->cct, 0) << s->err.message << dendl;
     return -ERR_INVALID_REQUEST;
   }
   return 0;