From: Yehuda Sadeh Date: Tue, 16 Jul 2013 01:43:56 +0000 (-0700) Subject: rgw: handle ENOENT when listing bucket metadata entries X-Git-Tag: v0.67-rc1~71^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F438%2Fhead;p=ceph.git rgw: handle ENOENT when listing bucket metadata entries Just return success (with an empty list) Signed-off-by: Yehuda Sadeh --- 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