]> git.apps.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)
committerMatan Breizman <mbreizma@redhat.com>
Sun, 21 May 2023 09:10:06 +0000 (09:10 +0000)
Signed-off-by: Xuehan Xu <xxhdx1985126@gmail.com>
(cherry picked from commit f34faf363e69053d18d50263ee02ca5948b6462c)

src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cached_extent.h

index 97b60eb400686ce8669002ef38cf8e9b3c5e4933..243d1dffd037df0a66c76654185f040a82fadfa8 100644 (file)
@@ -995,7 +995,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;