]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/common/operation: fix and move exit() after entering the next phase 57503/head
authorYingxin Cheng <yingxin.cheng@intel.com>
Tue, 16 Apr 2024 07:53:47 +0000 (15:53 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Thu, 16 May 2024 11:43:27 +0000 (14:43 +0300)
If exit/unlock the barrier before entering the next phase, it is
possible for the next request to exit the barrier at the same time, and
enters the next phase first, causing reorder issues.

Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
(cherry picked from commit 078768ff961abad12cf3e7f19190a6f986fc5fce)

src/crimson/common/operation.h

index bd3d79eec42b18aef52bf7dae70b004d78c394a1..82d0d548442e89197695f250740fd9aa77c244a5 100644 (file)
@@ -528,18 +528,18 @@ public:
     if (wait_fut.has_value()) {
       return wait_fut.value().then([this, &stage, t=std::move(t)] () mutable {
         auto fut = t.maybe_record_blocking(stage.enter(t), stage);
-        exit();
         return std::move(fut).then(
           [this, t=std::move(t)](auto &&barrier_ref) mutable {
+          exit();
           barrier = std::move(barrier_ref);
           return seastar::now();
         });
       });
     } else {
         auto fut = t.maybe_record_blocking(stage.enter(t), stage);
-        exit();
         return std::move(fut).then(
           [this, t=std::move(t)](auto &&barrier_ref) mutable {
+          exit();
           barrier = std::move(barrier_ref);
           return seastar::now();
         });