From: Yan Jun Date: Mon, 20 Jun 2016 15:34:52 +0000 (+0800) Subject: rgw: fix the missing return value of init_watch X-Git-Tag: v11.0.0~4^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dddf771d383a448addfe81f0d9b8ee6f46512f6d;p=ceph-ci.git rgw: fix the missing return value of init_watch we should return the negative error number if "ioctx_create" creates "control_pool_ctx" failed. otherwise, it will run into exception: r = control_pool_ctx.create(notify_oid, false); if (r < 0 && r != -EEXIST) return r; Signed-off-by: Yan Jun --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 2af3a7038ff..af65325732d 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3974,7 +3974,6 @@ int RGWRados::init_watch() librados::Rados *rad = &rados[0]; int r = rad->ioctx_create(control_pool, control_pool_ctx); - if (r == -ENOENT) { r = rad->pool_create(control_pool); if (r == -EEXIST) @@ -3985,6 +3984,8 @@ int RGWRados::init_watch() r = rad->ioctx_create(control_pool, control_pool_ctx); if (r < 0) return r; + } else if (r < 0) { + return r; } num_watchers = cct->_conf->rgw_num_control_oids;