From: Orit Wasserman Date: Tue, 19 Jan 2016 14:09:35 +0000 (+0100) Subject: rgw: fix RGWSystemMetaObj::init to handle perdefined name correctly X-Git-Tag: v10.1.0~354^2~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2360e165a1a0e6a52e992fdffb658d5d3616c6f9;p=ceph.git rgw: fix RGWSystemMetaObj::init to handle perdefined name correctly Signed-off-by: Orit Wasserman --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index f323287f7b02..02aca1eed546 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -377,11 +377,11 @@ int RGWSystemMetaObj::init(CephContext *_cct, RGWRados *_store, bool setup_obj, int r; if (name.empty()) { name = get_predefined_name(cct); - if (id.empty()) { - r = use_default(old_format); - if (r < 0) { - return r; - } + } + if (name.empty()) { + r = use_default(old_format); + if (r < 0) { + return r; } } else if (!old_format) { r = read_id(name, id); @@ -1041,7 +1041,6 @@ int RGWPeriod::read_info() rgw_bucket pool(pool_name.c_str()); bufferlist bl; - RGWObjectCtx obj_ctx(store); int ret = rgw_get_system_obj(store, obj_ctx, pool, get_period_oid(), bl, NULL, NULL); if (ret < 0) {