From: Kotresh HR Date: Mon, 24 Feb 2025 21:22:42 +0000 (+0530) Subject: multimds: Consistent view of referent inode list X-Git-Tag: v20.3.0~377^2~26 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0ed8c2a2b1c106754fb7a1ddb35d39b7c48bcd28;p=ceph.git multimds: Consistent view of referent inode list 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 --- diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 37892fabca2c9..e45219d87f2b6 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -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)); }