]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/seastore/cache: consider EXIST_CLEAN extents as pending ones
authorXuehan Xu <xxhdx1985126@gmail.com>
Fri, 24 Mar 2023 10:43:57 +0000 (18:43 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Mon, 27 Mar 2023 07:32:34 +0000 (15:32 +0800)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index 86e307246f3b753ee89061818bbc3f068ea83b2f..86c3730fd8b4d575cfd56dbb0bced46fe868048e 100644 (file)
@@ -999,7 +999,7 @@ CachedExtentRef Cache::duplicate_for_write(
   Transaction &t,
   CachedExtentRef i) {
   LOG_PREFIX(Cache::duplicate_for_write);
-  if (i->is_pending())
+  if (i->is_mutable())
     return i;
 
   if (i->is_exist_clean()) {
index 29cfd687ae34a414d54c8d059a61e5372201826f..e4c3ec50f13f30b4fd5c341edb061aa537c75083 100644 (file)
@@ -280,13 +280,17 @@ public:
     return TCachedExtentRef<const T>(static_cast<const T*>(this));
   }
 
-  /// Returns true if extent is part of an open transaction
-  bool is_pending() const {
+  bool is_mutable() const {
     return state == extent_state_t::INITIAL_WRITE_PENDING ||
       state == extent_state_t::MUTATION_PENDING ||
       state == extent_state_t::EXIST_MUTATION_PENDING;
   }
 
+  /// Returns true if extent is part of an open transaction
+  bool is_pending() const {
+    return is_mutable() || state == extent_state_t::EXIST_CLEAN;
+  }
+
   /// Returns true if extent has a pending delta
   bool is_mutation_pending() const {
     return state == extent_state_t::MUTATION_PENDING;