]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: get bucket info only if bucket name is not empty
authorYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 26 Aug 2011 21:10:25 +0000 (14:10 -0700)
committerYehuda Sadeh <yehuda@hq.newdream.net>
Fri, 26 Aug 2011 21:11:06 +0000 (14:11 -0700)
src/rgw/rgw_op.cc

index 0dd79af933d7892e7510c40105ba2ac5288ef1cd..b357fb2683ae7e7936487f9c1205904b1221f91c 100644 (file)
@@ -231,13 +231,15 @@ int read_acls(struct req_state *s, bool only_bucket)
     rgwstore->set_atomic(s->obj_ctx, obj);
   }
 
-  RGWBucketInfo bucket_info;
-  ret = rgw_get_bucket_info(s->bucket_name_str, bucket_info);
-  if (ret < 0) {
-    RGW_LOG(0) << "couldn't get bucket from bucket_name (name=" << s->bucket_name_str << ")" << dendl;
-    return ret;
+  if (s->bucket_name_str.size()) {
+    RGWBucketInfo bucket_info;
+    ret = rgw_get_bucket_info(s->bucket_name_str, bucket_info);
+    if (ret < 0) {
+      RGW_LOG(0) << "couldn't get bucket from bucket_name (name=" << s->bucket_name_str << ")" << dendl;
+      return ret;
+    }
+    s->bucket = bucket_info.bucket;
   }
-  s->bucket = bucket_info.bucket;
 
   ret = read_acls(s, s->acl, s->bucket, obj_str);