From: Yehuda Sadeh Date: Thu, 5 Jan 2017 21:15:56 +0000 (-0800) Subject: rgw: get_obj_state() checks for empty oids X-Git-Tag: v12.0.1~111^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8310c8f26d4d587678909ccd1d6b094399bca141;p=ceph-ci.git rgw: get_obj_state() checks for empty oids Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 97224a352c5..499141f6f76 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -8450,6 +8450,10 @@ int RGWRados::get_olh_target_state(RGWObjectCtx& obj_ctx, const RGWBucketInfo& b int RGWRados::get_system_obj_state_impl(RGWObjectCtx *rctx, rgw_raw_obj& obj, RGWRawObjState **state, RGWObjVersionTracker *objv_tracker) { + if (obj.empty()) { + return -EINVAL; + } + RGWRawObjState *s = rctx->raw.get_state(obj); ldout(cct, 20) << "get_system_obj_state: rctx=" << (void *)rctx << " obj=" << obj << " state=" << (void *)s << " s->prefetch_data=" << s->prefetch_data << dendl; *state = s; @@ -8496,6 +8500,10 @@ int RGWRados::get_system_obj_state(RGWObjectCtx *rctx, rgw_raw_obj& obj, RGWRawO int RGWRados::get_obj_state_impl(RGWObjectCtx *rctx, const RGWBucketInfo& bucket_info, const rgw_obj& obj, RGWObjState **state, bool follow_olh, bool assume_noent) { + if (obj.empty()) { + return -EINVAL; + } + bool need_follow_olh = follow_olh && obj.key.instance.empty(); RGWObjState *s = rctx->obj.get_state(obj);