]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix get_obj() with zero sized obj
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 18 Apr 2013 20:30:45 +0000 (13:30 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Wed, 8 May 2013 18:01:17 +0000 (11:01 -0700)
Now that even zero sized objs have manifest a
test had to be modified.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
src/rgw/rgw_rados.cc

index 1e84d89361fdda26c532d56e99cc83d5b2860a30..679cbb1da318697cb8f6c1577cb745485a92dde2 100644 (file)
@@ -3086,7 +3086,8 @@ int RGWRados::get_obj(void *ctx, RGWObjVersionTracker *objv_tracker, void **hand
   else
     len = end - ofs + 1;
 
-  if (astate->has_manifest) {
+  if (astate->has_manifest &&
+      astate->manifest.objs.size() > 0) {
     /* now get the relevant object part */
     map<uint64_t, RGWObjManifestPart>::iterator iter = astate->manifest.objs.upper_bound(ofs);
     /* we're now pointing at the next part (unless the first part starts at a higher ofs),