]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: get_obj_state() checks for empty oids
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 5 Jan 2017 21:15:56 +0000 (13:15 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Thu, 9 Mar 2017 17:18:56 +0000 (09:18 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rados.cc

index 97224a352c5c8f19ce5d9e195682282f32969ee0..499141f6f764dcceda15d43376b3d925274a2dc2 100644 (file)
@@ -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);