From 9a716d88bb5fad59a20d5396c5dbb738466629f5 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Sat, 3 May 2014 01:34:10 +0200 Subject: [PATCH] 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 --- src/rgw/rgw_bucket.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 9827bad309c..ed6443b287c 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -74,9 +74,10 @@ int rgw_read_user_buckets(RGWRados *store, string user_id, RGWUserBuckets& bucke if (need_stats) { map& 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;