From 408014ee462a9fcf92971f90a3745f815a813d84 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Mon, 15 Jul 2013 18:43:56 -0700 Subject: [PATCH] rgw: handle ENOENT when listing bucket metadata entries Just return success (with an empty list) Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_bucket.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index 23354233c963..aae7d31e21cc 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1476,8 +1476,13 @@ public: int ret = store->list_raw_objects(store->zone.domain_root, no_filter, max, info->ctx, unfiltered_keys, truncated); - if (ret < 0) + if (ret < 0 && ret != -ENOENT) return ret; + if (ret == -ENOENT) { + if (truncated) + *truncated = false; + return 0; + } // now filter out the system entries list::iterator iter; @@ -1618,8 +1623,13 @@ public: int ret = store->list_raw_objects(store->zone.domain_root, no_filter, max, info->ctx, unfiltered_keys, truncated); - if (ret < 0) + if (ret < 0 && ret != -ENOENT) return ret; + if (ret == -ENOENT) { + if (truncated) + *truncated = false; + return 0; + } int prefix_size = sizeof(RGW_BUCKET_INSTANCE_MD_PREFIX) - 1; // now filter in the relevant entries -- 2.47.3