]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix dereference of empty std::optional in RGWDeleteMultiObj::execute()
authorCory Snyder <csnyder@iland.com>
Mon, 12 Dec 2022 08:04:20 +0000 (03:04 -0500)
committerCory Snyder <csnyder@1111systems.com>
Wed, 18 Jan 2023 20:43:42 +0000 (15:43 -0500)
Fixes a crash that occurs when RGW is executed without an async context.

Fixes: https://tracker.ceph.com/issues/58243
Signed-off-by: Cory Snyder <csnyder@iland.com>
(cherry picked from commit 91ff9591b095e8e73e4dff5c4a3fe3c66c0de9b6)

src/rgw/rgw_op.cc

index 075a0944c6e149adf9e13fed537e1bc9af26976d..f62e3687ec569d9cef87c453121cfa6856e5f8d0 100644 (file)
@@ -7269,9 +7269,11 @@ void RGWDeleteMultiObj::execute(optional_yield y)
       handle_individual_object(obj_key, y, &*formatter_flush_cond);
     }
   }
-  wait_flush(y, &*formatter_flush_cond, [this, n=multi_delete->objects.size()] {
-    return n == ops_log_entries.size();
-  });
+  if (formatter_flush_cond) {
+    wait_flush(y, &*formatter_flush_cond, [this, n=multi_delete->objects.size()] {
+      return n == ops_log_entries.size();
+    });
+  }
 
   /*  set the return code to zero, errors at this point will be
   dumped to the response */