]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: acquire locks strictly by OSDOp type
authorXuehan Xu <xxhdx1985126@gmail.com>
Mon, 8 Mar 2021 07:51:49 +0000 (15:51 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Wed, 10 Mar 2021 02:24:08 +0000 (10:24 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/osd/pg.cc

index 0e335a2180f4ef14f5f1ec9a35957c8ea4c88c41..afe182cb649e0af2bf634981143fc43d410c51e5 100644 (file)
@@ -997,9 +997,9 @@ PG::with_locked_obc(Ref<MOSDOp> &m, const OpInfo &op_info,
     }
   case RWState::RWEXCL:
     if (oid.is_head()) {
-      return with_head_obc<RWState::RWWRITE>(oid, std::move(f));
+      return with_head_obc<RWState::RWEXCL>(oid, std::move(f));
     } else {
-      return with_clone_obc<RWState::RWWRITE>(oid, std::move(f));
+      return with_clone_obc<RWState::RWEXCL>(oid, std::move(f));
     }
   default:
     ceph_abort();