From: Yehuda Sadeh Date: Thu, 3 Mar 2016 21:48:32 +0000 (-0800) Subject: rgw: adjust error code when bucket does not exist in copy operation X-Git-Tag: v10.1.0~230^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0b48c8688bab15a7be37a1cf3d215fc409234a83;p=ceph.git rgw: adjust error code when bucket does not exist in copy operation Fixes: #14975 Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index a6272e164f8e..0bffc77c5ed4 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -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;