]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set locator key before calling get_obj_state()
authorSage Weil <sage@newdream.net>
Wed, 5 Oct 2011 20:07:59 +0000 (13:07 -0700)
committerSage Weil <sage@newdream.net>
Wed, 5 Oct 2011 20:07:59 +0000 (13:07 -0700)
get_obj_state assumes the io_ctx is ready to go.  Set the locator key
earlier rather than later.

Signed-off-by: Sage Weil <sage@newdream.net>
src/rgw/rgw_rados.cc

index 1aef1d9d4b78983456b5ab1e3e461caa98d8a783..3faf25a682b3d37ee9e8f994f460ffd5d8da6cb2 100644 (file)
@@ -1671,6 +1671,7 @@ int RGWRados::obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime)
   int r = open_bucket_ctx(bucket, io_ctx);
   if (r < 0)
     return r;
+  io_ctx.locator_set_key(key);
 
   if (rctx) {
     RGWObjState *astate;
@@ -1689,8 +1690,6 @@ int RGWRados::obj_stat(void *ctx, rgw_obj& obj, uint64_t *psize, time_t *pmtime)
     return 0;
   }
 
-  io_ctx.locator_set_key(key);
-
   r = io_ctx.stat(oid, psize, pmtime);
   return r;
 }