From: Rishabh Dave Date: Fri, 3 Oct 2025 12:01:22 +0000 (+0530) Subject: mds,include: compare fscrypt fields too for inode divergence X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=abadd70a71763744dbdf8e681ff97af4578e600f;p=ceph.git mds,include: compare fscrypt fields too for inode divergence Fixes: https://tracker.ceph.com/issues/70188 Signed-off-by: Rishabh Dave --- diff --git a/src/include/cephfs/types.h b/src/include/cephfs/types.h index 327b355fd573..8c53e5fed56b 100644 --- a/src/include/cephfs/types.h +++ b/src/include/cephfs/types.h @@ -934,6 +934,18 @@ private: bool older_is_consistent(const inode_t &other) const; }; +template class Allocator> +inline bool operator==(std::vector> l, + std::vector> r) { + return l.size() == r.size() && memcmp(l.data(), r.data(), l.size()) == 0; +} + +template class Allocator> +inline bool operator!=(std::vector> l, + std::vector> r) { + return l.size() != r.size() || memcmp(l.data(), r.data(), l.size()) != 0; +} + // These methods may be moved back to mdstypes.cc when we have pmr template class Allocator> void inode_t::encode(ceph::buffer::list &bl, uint64_t features) const @@ -1178,6 +1190,9 @@ int inode_t::compare(const inode_t &other, bool *divergent file_data_version != other.file_data_version || xattr_version != other.xattr_version || backtrace_version != other.backtrace_version || + fscrypt_auth != other.fscrypt_auth || + fscrypt_file != other.fscrypt_file || + fscrypt_last_block != other.fscrypt_last_block || remote_ino != other.remote_ino || referent_inodes != other.referent_inodes) { *divergent = true;