From: Yehuda Sadeh Date: Thu, 22 Aug 2013 17:53:12 +0000 (-0700) Subject: rgw: fix crash when creating new zone on init X-Git-Tag: v0.68~18 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3d55534268de7124d29bd365ea65da8d2f63e501;p=ceph.git 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 Signed-off-by: Yehuda Sadeh --- diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 0bbbf177b7a3..03cc1ebfdb33 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::iterator ziter; for (ziter = region.zones.begin(); ziter != region.zones.end(); ++ziter) { const string& name = ziter->first;