Don't try to sync an object with empty name (shouldn't happen, but
bugs may happen). Also, don't try to write_meta() of an empty object
name, in case we get there through a different path somehow.
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
do {
yield {
marker_tracker->reset_need_retry(key);
+ if (key.name.empty()) {
+ /* shouldn't happen */
+ set_status("skipping empty entry");
+ ldout(sync_env->cct, 0) << "ERROR: " << __func__ << "(): entry with empty obj name, skipping" << dendl;
+ goto done;
+ }
if (op == CLS_RGW_OP_ADD ||
op == CLS_RGW_OP_LINK_OLH) {
if (op == CLS_RGW_OP_ADD && !key.instance.empty() && key.instance != "null") {
return r;
rgw_obj& obj = target->get_obj();
+
+ if (obj.get_object().empty()) {
+ ldout(store->ctx(), 0) << "ERROR: " << __func__ << "(): cannot write object with empty name" << dendl;
+ return -EIO;
+ }
+
r = store->get_obj_ref(obj, &ref, &bucket);
if (r < 0)
return r;