]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/reshard: avoid infinite loop if bi_list() returns -ENOENT 50329/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 1 Mar 2023 22:20:06 +0000 (17:20 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 1 Mar 2023 22:20:06 +0000 (17:20 -0500)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/rgw_reshard.cc

index 01d917022d30ba0febe7bc1d1beed67848e1a0d9..2abf029080fc3db75055d8f8a253c43babbc4e1e 100644 (file)
@@ -837,7 +837,12 @@ int RGWBucketReshard::do_reshard(const rgw::bucket_index_layout_generation& curr
     while (is_truncated) {
       entries.clear();
       int ret = store->getRados()->bi_list(dpp, bucket_info, i, null_object_filter, marker, max_entries, &entries, &is_truncated);
-      if (ret < 0 && ret != -ENOENT) {
+      if (ret == -ENOENT) {
+        ldpp_dout(dpp, 1) << "WARNING: " << __func__ << " failed to find shard "
+            << i << ", skipping" << dendl;
+        // break out of the is_truncated loop and move on to the next shard
+        break;
+      } else if (ret < 0) {
         derr << "ERROR: bi_list(): " << cpp_strerror(-ret) << dendl;
         return ret;
       }