From b91490d35319b6e215cc9fc82e7ca5af55e2e309 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 14 Jan 2021 19:55:43 -0800 Subject: [PATCH] mds: fix alternate_name durability This is a collection of fixes to Xiubo's prior work. Namely: - Add new mds_alternate_name_max option to limit the size of alternate_name. Otherwise a Client could trick the MDS into creating an alternate_name of any size! - Clean up how alternate_name is assigned to CDentry. In the general case, this should be assigned as part of creating the dentry. We want this value to be immutable for the life of the dentry. Even for the very special case of rename(2) where the destination dentry already exists. We explicitly check (after discussion with Jeff) that the target dentry alternate_name already matches what the rename RPC is giving. - The MDS is now properly journaling the alternate_name. - The MDS rejoin phase is properly transmitting each dentry's alternate_name. I've discovered that this MMDSCacheRejoin message actually wasn't versioned which I've raised in a tracker [1]. In the mean time, we'll just bump CEPH_MDS_PROTOCOL as usual. [1] https://tracker.ceph.com/issues/48886 Signed-off-by: Patrick Donnelly --- src/common/options.cc | 5 ++ src/mds/CDentry.cc | 18 ++++---- src/mds/CDentry.h | 25 +++++++--- src/mds/CDir.cc | 45 +++++++++--------- src/mds/CDir.h | 3 +- src/mds/Locker.cc | 4 +- src/mds/MDCache.cc | 34 +++++++++----- src/mds/MDSDaemon.h | 2 +- src/mds/MDSRank.cc | 1 + src/mds/Migrator.cc | 13 +++--- src/mds/Server.cc | 83 +++++++++++++++++++++++++++------- src/mds/Server.h | 5 +- src/mds/events/EMetaBlob.h | 46 +++++++++++-------- src/mds/journal.cc | 26 ++++++++--- src/messages/MClientReply.h | 15 ++++-- src/messages/MClientRequest.h | 2 + src/messages/MMDSCacheRejoin.h | 29 ++++++------ src/messages/MMDSPeerRequest.h | 3 ++ 18 files changed, 238 insertions(+), 121 deletions(-) diff --git a/src/common/options.cc b/src/common/options.cc index 71133bdfb81d7..d0a2104c45485 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -7953,6 +7953,11 @@ static std::vector