rgw_bucket.cc: return error if update_containers_stats() fails

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>
This commit is contained in:
Danny Al-Gaaf 2014-05-03 01:34:10 +02:00
parent aafed10cd6
commit 9a716d88bb

View File

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