diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-08-22 10:53:12 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-08-23 15:37:18 -0700 |
commit | a4cca31c82bf0e84272e01eb1b3188dfdb5b5615 (patch) | |
tree | 3e8c405ed7a1991a8e72be35f231d54a12c2cc7f | |
parent | 4cf6996803ef66f2b6083f73593259d45e2740a3 (diff) | |
download | ceph-a4cca31c82bf0e84272e01eb1b3188dfdb5b5615.tar.gz |
rgw: fix crash when creating new zone on init
Moving the watch/notify init before the zone init,
as we might need to send a notification.
Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
(cherry picked from commit 3d55534268de7124d29bd365ea65da8d2f63e501)
-rw-r--r-- | src/rgw/rgw_rados.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0bbbf177b7a..03cc1ebfdb3 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -875,6 +875,14 @@ int RGWRados::init_complete() { int ret; + if (need_watch_notify()) { + ret = init_watch(); + if (ret < 0) { + lderr(cct) << "ERROR: failed to initialize watch" << dendl; + return ret; + } + } + ret = region.init(cct, this); if (ret < 0) return ret; @@ -912,14 +920,6 @@ int RGWRados::init_complete() } } - if (need_watch_notify()) { - ret = init_watch(); - if (ret < 0) { - lderr(cct) << "ERROR: failed to initialize watch" << dendl; - return ret; - } - } - map<string, RGWZone>::iterator ziter; for (ziter = region.zones.begin(); ziter != region.zones.end(); ++ziter) { const string& name = ziter->first; |