From 7204cf1e8a77d91e5f4d9131c2d4d6e59174ba79 Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 21 Jun 2021 15:59:18 -0400 Subject: [PATCH] mds: encode fscrypt_auth and fscrypt_file in InodeStat Signed-off-by: Jeff Layton --- src/mds/CInode.cc | 4 +++- src/messages/MClientReply.h | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 23e98e7fb15c..7c6285e4d6b2 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -4010,7 +4010,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session, * note: encoding matches MClientReply::InodeStat */ if (session->info.has_feature(CEPHFS_FEATURE_REPLY_ENCODING)) { - ENCODE_START(6, 1, bl); + ENCODE_START(7, 1, bl); encode(oi->ino, bl); encode(snapid, bl); encode(oi->rdev, bl); @@ -4056,6 +4056,8 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session, encode(file_i->rstat.rsnaps, bl); encode(snap_metadata, bl); encode(!file_i->fscrypt_auth.empty(), bl); + encode(file_i->fscrypt_auth, bl); + encode(file_i->fscrypt_file, bl); ENCODE_FINISH(bl); } else { diff --git a/src/messages/MClientReply.h b/src/messages/MClientReply.h index b5a99a5f9d89..46271c2327d0 100644 --- a/src/messages/MClientReply.h +++ b/src/messages/MClientReply.h @@ -158,7 +158,7 @@ struct InodeStat { void decode(ceph::buffer::list::const_iterator &p, const uint64_t features) { using ceph::decode; if (features == (uint64_t)-1) { - DECODE_START(6, p); + DECODE_START(7, p); decode(vino.ino, p); decode(vino.snapid, p); decode(rdev, p); @@ -215,7 +215,11 @@ struct InodeStat { if (struct_v >= 6) { bool fscrypt_flag; - decode(fscrypt_flag, p); + decode(fscrypt_flag, p); // ignore this + } + if (struct_v >= 7) { + decode(fscrypt_auth, p); + decode(fscrypt_file, p); } DECODE_FINISH(p); } -- 2.47.3