]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not use item item_caps in two different lists 56887/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:02:19 +0000 (17:32 +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 cdb39e6081cb11277b7f54c9437a2458081b85bc..9817f10fb641f69d0d8880d2254094297595712e 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)
@@ -2311,7 +2311,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);
     }
   }
@@ -3179,15 +3179,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;
@@ -4295,7 +4295,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 0226ce32f719a70ebeb56c9a86f29c2b2a4dc0ac..97bab8b24b2d5b7d856b79925e1ad2dbbd0008c3 100644 (file)
@@ -333,6 +333,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());
   }