Remove bucket API returns NoSuchKey but NoSuchBucket is appropriate in this case.
Code path:
RGWRadosStore::get_bucket
-> RGWRadosBucket::get_bucket_info
-> RGWBucketCtl::read_bucket_info
-> RGWBucketCtl::read_bucket_entrypoint_info
-> RGWSI_Bucket_SObj::read_bucket_entrypoint_info
-> RGWSI_MetaBackend_SObj::get_entry
-> rgw_get_system_obj
-> RGWSI_SysObj::Obj::ROp::stat
-> RGWSI_SysObj_Core::stat # return -ENOENT here.
[1]: https://docs.ceph.com/en/pacific/radosgw/adminops/#remove-bucket
Fixes: https://tracker.ceph.com/issues/53731
Signed-off-by: Satoru Takeuchi <satoru.takeuchi@gmail.com>
(cherry picked from commit
375c22aba3ea1d4af6b05a3c83b0aee6ad2a0b6a)
op_ret = store->get_bucket(s, s->user.get(), string(), bucket_name, &bucket, y);
if (op_ret < 0) {
ldpp_dout(this, 0) << "get_bucket returned ret=" << op_ret << dendl;
+ if (op_ret == -ENOENT) {
+ op_ret = -ERR_NO_SUCH_BUCKET;
+ }
return;
}
return new RGWOp_Object_Remove;
return new RGWOp_Bucket_Remove;
-}
-
+}
\ No newline at end of file
}
return m.size();
-}
-
+}
\ No newline at end of file