]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add check for update return value 13273/head
authorOrit Wasserman <owasserm@redhat.com>
Sun, 22 Jan 2017 13:05:30 +0000 (15:05 +0200)
committerAlexey Sheplyakov <asheplyakov@mirantis.com>
Mon, 6 Feb 2017 12:52:14 +0000 (16:52 +0400)
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
(cherry picked from commit 125955e0625461065dc4755b900e51c3598cadb4)

src/rgw/rgw_rados.cc

index 9225613fa94ea7e89577a4e1bf4eff49ab48ff7e..424b80831ba35376260ad61dc2bf59582078028e 100644 (file)
@@ -3615,7 +3615,11 @@ int RGWRados::init_zg_from_period(bool *initialized)
          master->second.name << " id:" << master->second.id << " as master" << dendl;
        if (zonegroup.get_id() == zg.get_id()) {
          zonegroup.master_zone = master->second.id;
-         zonegroup.update();
+         ret = zonegroup.update();
+         if (ret < 0) {
+           ldout(cct, 0) << "error updating zonegroup : " << cpp_strerror(-ret) << dendl;
+           return ret;
+         }
        } else {
          RGWZoneGroup fixed_zg(zg.get_id(),zg.get_name());
          ret = fixed_zg.init(cct, this);
@@ -3624,7 +3628,11 @@ int RGWRados::init_zg_from_period(bool *initialized)
            return ret;
          }
          fixed_zg.master_zone = master->second.id;
-         fixed_zg.update();
+         ret = fixed_zg.update();
+         if (ret < 0) {
+           ldout(cct, 0) << "error initializing zonegroup : " << cpp_strerror(-ret) << dendl;
+           return ret;
+         }
        }
       } else {
        ldout(cct, 0) << "zonegroup " << zg.get_name() << " missing zone for master_zone=" <<
@@ -3678,7 +3686,11 @@ int RGWRados::init_zg_from_local(bool *creating_defaults)
        ldout(cct, 0) << "zonegroup " << zonegroup.get_name() << " missing master_zone, setting zone " <<
          master->second.name << " id:" << master->second.id << " as master" << dendl;
        zonegroup.master_zone = master->second.id;
-       zonegroup.update();
+       ret = zonegroup.update();
+       if (ret < 0) {
+         ldout(cct, 0) << "error initializing zonegroup : " << cpp_strerror(-ret) << dendl;
+         return ret;
+       }
       } else {
        ldout(cct, 0) << "zonegroup " << zonegroup.get_name() << " missing zone for "
           "master_zone=" << zonegroup.master_zone << dendl;