]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not use item item_caps in two different lists 55914/head
authorDhairya Parmar <dparmar@redhat.com>
Mon, 4 Mar 2024 08:41:38 +0000 (14:11 +0530)
committerDhairya Parmar <dparmar@redhat.com>
Fri, 15 Mar 2024 08:49:26 +0000 (14:19 +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>
src/mds/Locker.cc
src/mds/MDCache.cc

index 0247be6db5df92c2a880eaa9deee76f94f9fbb4c..9568800b41a62adce982cfca7e6ac20c5a241fcd 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)
@@ -2178,7 +2178,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);
     }
   }
@@ -3037,15 +3037,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;
@@ -4153,7 +4153,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 f79e806494bf6752aa78de0e6a96265daa5f8901..fef85a50f3fc8712104ff42663b50f0027f5a45b 100644 (file)
@@ -312,6 +312,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());
   }