]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
multimds: Consistent view of referent inode list
authorKotresh HR <khiremat@redhat.com>
Mon, 24 Feb 2025 21:22:42 +0000 (02:52 +0530)
committerKotresh HR <khiremat@redhat.com>
Tue, 4 Mar 2025 06:20:47 +0000 (11:50 +0530)
Encode/Decode referent inode list with CEPH_LOCK_ILINK
lock along with ctime and nlink. This solves the consistent
view of the referent inode list to all it's inode replica mdses.

Fixes: https://tracker.ceph.com/issues/54205
Signed-off-by: Kotresh HR <khiremat@redhat.com>
src/mds/CInode.cc

index 37892fabca2c999dbe7ba8079bfa07c0cb3ed4b8..e45219d87f2b6c40e2002846f0e97a1bf108ed34 100644 (file)
@@ -1749,10 +1749,11 @@ void CInode::decode_lock_iauth(bufferlist::const_iterator& p)
 
 void CInode::encode_lock_ilink(bufferlist& bl)
 {
-  ENCODE_START(1, 1, bl);
+  ENCODE_START(2, 1, bl);
   encode(get_inode()->version, bl);
   encode(get_inode()->ctime, bl);
   encode(get_inode()->nlink, bl);
+  encode(get_inode()->referent_inodes, bl);
   ENCODE_FINISH(bl);
 }
 
@@ -1766,6 +1767,8 @@ void CInode::decode_lock_ilink(bufferlist::const_iterator& p)
   decode(tm, p);
   if (_inode->ctime < tm) _inode->ctime = tm;
   decode(_inode->nlink, p);
+  if (struct_v >= 2)
+    decode(_inode->referent_inodes, p);
   DECODE_FINISH(p);
   reset_inode(std::move(_inode));
 }