]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: if extra data pool name is empty, use data pool name instead
authorYehuda Sadeh <yehuda@inktank.com>
Fri, 30 May 2014 21:47:25 +0000 (14:47 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Wed, 2 Jul 2014 00:38:35 +0000 (17:38 -0700)
Fixes: #8311
An empty pool name could be used as the extra data pool.

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit b300318113b162522759d4794b1cfa3d1d9398e4)

src/rgw/rgw_rados.cc

index 36690ce1c9c0ffc962bdb189b0ac6b9dc61c8a24..cf6e06616b0b1ebf6549f0d0d417c53f951f6297 100644 (file)
@@ -1691,7 +1691,8 @@ int RGWRados::open_bucket_data_ctx(rgw_bucket& bucket, librados::IoCtx& data_ctx
 
 int RGWRados::open_bucket_data_extra_ctx(rgw_bucket& bucket, librados::IoCtx& data_ctx)
 {
-  int r = open_bucket_pool_ctx(bucket.name, bucket.data_extra_pool, data_ctx);
+  string& pool = (!bucket.data_extra_pool.empty() ? bucket.data_extra_pool : bucket.data_pool);
+  int r = open_bucket_pool_ctx(bucket.name, pool, data_ctx);
   if (r < 0)
     return r;