]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: decode the req_state bucket instance id if needed
authorYehuda Sadeh <yehuda@redhat.com>
Wed, 3 Dec 2014 19:30:44 +0000 (11:30 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Wed, 14 Jan 2015 03:21:25 +0000 (19:21 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_op.cc

index 124511026d7a8c5b501eb66dfc855f1d03473b41..625f081a9a5348582f134d536ae99267ff142c38 100644 (file)
@@ -322,7 +322,14 @@ static int rgw_build_policies(RGWRados *store, struct req_state *s, bool only_bu
   string obj_str;
   RGWUserInfo bucket_owner_info;
 
-  s->bucket_instance_id = s->info.args.get(RGW_SYS_PARAM_PREFIX "bucket-instance");
+  string bi = s->info.args.get(RGW_SYS_PARAM_PREFIX "bucket-instance");
+  if (!bi.empty()) {
+    int shard_id;
+    ret = rgw_bucket_parse_bucket_instance(bi, &s->bucket_instance_id, &shard_id);
+    if (ret < 0) {
+      return ret;
+    }
+  }
 
   s->bucket_acl = new RGWAccessControlPolicy(s->cct);