]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not use item item_caps in two different lists 56886/head
authorDhairya Parmar <dparmar@redhat.com>
Mon, 4 Mar 2024 08:41:38 +0000 (14:11 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Mon, 15 Apr 2024 12:00:43 +0000 (17:30 +0530)
make use of item_to_flush instead of item_caps in Locker::need_snapflush_inodes

Fixes: https://tracker.ceph.com/issues/64008
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
(cherry picked from commit 207a9beac4b7863f071ce82b04b37ce8766e9178)

src/mds/Locker.cc
src/mds/MDCache.cc

index 0b1f640995506944cf7180e6378325cc696a7143..48cb02bd5bf6b5e101470fc663b3a777e171da13 100644 (file)
@@ -72,7 +72,7 @@ public:
 };
 
 Locker::Locker(MDSRank *m, MDCache *c) :
-  need_snapflush_inodes(member_offset(CInode, item_caps)), mds(m), mdcache(c) {}
+  need_snapflush_inodes(member_offset(CInode, item_to_flush)), mds(m), mdcache(c) {}
 
 
 void Locker::dispatch(const cref_t<Message> &m)
@@ -2196,7 +2196,7 @@ void Locker::file_update_finish(CInode *in, MutationRef& mut, unsigned flags,
        lock->put_wrlock();
       }
       in->item_open_file.remove_myself();
-      in->item_caps.remove_myself();
+      in->item_to_flush.remove_myself();
       eval_cap_gather(in, &need_issue);
     }
   }
@@ -3057,15 +3057,15 @@ void Locker::snapflush_nudge(CInode *in)
     _rdlock_kick(hlock, true);
   } else {
     // also, requeue, in case of unstable lock
-    need_snapflush_inodes.push_back(&in->item_caps);
+    need_snapflush_inodes.push_back(&in->item_to_flush);
   }
 }
 
 void Locker::mark_need_snapflush_inode(CInode *in)
 {
   ceph_assert(in->last != CEPH_NOSNAP);
-  if (!in->item_caps.is_on_list()) {
-    need_snapflush_inodes.push_back(&in->item_caps);
+  if (!in->item_to_flush.is_on_list()) {
+    need_snapflush_inodes.push_back(&in->item_to_flush);
     utime_t now = ceph_clock_now();
     in->last_dirstat_prop = now;
     dout(10) << "mark_need_snapflush_inode " << *in << " - added at " << now << dendl;
@@ -4175,7 +4175,7 @@ void Locker::caps_tick()
       CInode *in = need_snapflush_inodes.front();
       if (in->last_dirstat_prop >= cutoff)
        break;
-      in->item_caps.remove_myself();
+      in->item_to_flush.remove_myself();
       snapflush_nudge(in);
       if (in == last)
        break;
index 5480e6dcd5efef830b20d250c2817834b90c014f..08d9c8d469a7f8ca613abaa5197f17869bf2b63a 100644 (file)
@@ -306,6 +306,7 @@ void MDCache::remove_inode(CInode *o)
     inode_map.erase(o->ino());
   } else {
     o->item_caps.remove_myself();
+    o->item_to_flush.remove_myself();
     snap_inode_map.erase(o->vino());
   }