]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: adjust error code when bucket does not exist in copy operation
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 3 Mar 2016 21:48:32 +0000 (13:48 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 3 Mar 2016 21:49:39 +0000 (13:49 -0800)
Fixes: #14975
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_op.cc

index a6272e164f8e4b007f6834b6c109acf7f8a77bbd..0bffc77c5ed4086ff4713e2f40bc86dfeef8c84e 100644 (file)
@@ -2984,8 +2984,12 @@ int RGWCopyObj::verify_permission()
     /* will only happen in intra region sync where the source and dest bucket is the same */
     op_ret = store->get_bucket_instance_info(obj_ctx, s->bucket_instance_id, src_bucket_info, NULL, &src_attrs);
   }
-  if (op_ret < 0)
+  if (op_ret < 0) {
+    if (op_ret == -ENOENT) {
+      op_ret = -ERR_NO_SUCH_BUCKET;
+    }
     return op_ret;
+  }
 
   src_bucket = src_bucket_info.bucket;
 
@@ -3017,8 +3021,12 @@ int RGWCopyObj::verify_permission()
   } else {
     op_ret = store->get_bucket_info(obj_ctx, dest_tenant_name, dest_bucket_name,
                                    dest_bucket_info, NULL, &dest_attrs);
-    if (op_ret < 0)
+    if (op_ret < 0) {
+      if (op_ret == -ENOENT) {
+        op_ret = -ERR_NO_SUCH_BUCKET;
+      }
       return op_ret;
+    }
   }
 
   dest_bucket = dest_bucket_info.bucket;