]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore: fix do_transaction -- transactions may be empty
authorSamuel Just <sjust@redhat.com>
Fri, 30 Apr 2021 21:12:27 +0000 (14:12 -0700)
committerSamuel Just <sjust@redhat.com>
Fri, 7 May 2021 07:36:34 +0000 (00:36 -0700)
Signed-off-by: Samuel Just <sjust@redhat.com>
src/crimson/os/seastore/seastore.cc

index 0e5c5c1603e17175ceb585fd8b4c3ac59a9be317..ae86e4b79d4532693df689a220a05d4050cfdffd 100644 (file)
@@ -554,12 +554,16 @@ seastar::future<> SeaStore::do_transaction(
       ).safe_then([this, &ctx](auto &&read_onodes) {
        ctx.onodes = std::move(read_onodes);
        return crimson::do_until(
-         [this, &ctx] {
-           return _do_transaction_step(
-             ctx, ctx.ch, ctx.onodes, ctx.iter
-           ).safe_then([&ctx] {
-             return seastar::make_ready_future<bool>(!ctx.iter.have_op());
-           });
+         [this, &ctx]() -> tm_ertr::future<bool> {
+           if (ctx.iter.have_op()) {
+             return _do_transaction_step(
+               ctx, ctx.ch, ctx.onodes, ctx.iter
+             ).safe_then([] {
+               return seastar::make_ready_future<bool>(false);
+             });
+           } else {
+             return seastar::make_ready_future<bool>(true);
+           };
          });
       }).safe_then([this, &ctx] {
        return onode_manager->write_dirty(*ctx.transaction, ctx.onodes);