]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_bucket.cc: return error if update_containers_stats() fails
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 2 May 2014 23:34:10 +0000 (01:34 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 2 May 2014 23:34:10 +0000 (01:34 +0200)
In case need_stats is set on rgw_read_user_buckets() and the
update_containers_stats() call fails with !-ENOENT, not only
print out a message but also return the error to the function
caller.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/rgw/rgw_bucket.cc

index 9827bad309c9e3a195f698dab84ad5b09b68d861..ed6443b287c8feb03bd9ce20e1cae12e531145a4 100644 (file)
@@ -74,9 +74,10 @@ int rgw_read_user_buckets(RGWRados *store, string user_id, RGWUserBuckets& bucke
 
   if (need_stats) {
     map<string, RGWBucketEnt>& m = buckets.get_buckets();
-    int r = store->update_containers_stats(m);
-    if (r < 0) {
+    ret = store->update_containers_stats(m);
+    if (ret < 0 && ret != -ENOENT) {
       ldout(store->ctx(), 0) << "ERROR: could not get stats for buckets" << dendl;
+      return ret;
     }
   }
   return 0;