From b07a707ad0ea31b1ef34ea949751d14c55bc1e8a Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 29 Aug 2016 07:16:39 -0400 Subject: [PATCH] mds: pass change_attr in InodeStat MClientReply, if feature is present Signed-off-by: Jeff Layton --- src/mds/CInode.cc | 1 + src/messages/MClientReply.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mds/CInode.cc b/src/mds/CInode.cc index 11f50fd97d4..365f3ab812e 100644 --- a/src/mds/CInode.cc +++ b/src/mds/CInode.cc @@ -3359,6 +3359,7 @@ int CInode::encode_inodestat(bufferlist& bl, Session *session, } if (session->connection->has_feature(CEPH_FEATURE_FS_BTIME)) { ::encode(any_i->btime, bl); + ::encode(any_i->change_attr, bl); } return valid; diff --git a/src/messages/MClientReply.h b/src/messages/MClientReply.h index a9974481975..c5e7d3912de 100644 --- a/src/messages/MClientReply.h +++ b/src/messages/MClientReply.h @@ -105,6 +105,7 @@ struct InodeStat { utime_t ctime, btime, mtime, atime; uint32_t time_warp_seq; uint64_t size, max_size; + uint64_t change_attr; uint64_t truncate_size; uint32_t truncate_seq; uint32_t mode, uid, gid, nlink; @@ -185,10 +186,13 @@ struct InodeStat { if ((features & CEPH_FEATURE_FS_FILE_LAYOUT_V2)) ::decode(layout.pool_ns, p); - if ((features & CEPH_FEATURE_FS_BTIME)) + if ((features & CEPH_FEATURE_FS_BTIME)) { ::decode(btime, p); - else + ::decode(change_attr, p); + } else { btime = utime_t(); + change_attr = 0; + } } // see CInode::encode_inodestat for encoder. -- 2.39.5