From: Xiubo Li Date: Thu, 25 Nov 2021 00:52:37 +0000 (+0800) Subject: mds: add mds_fscrypt_last_block_max_size option support X-Git-Tag: v18.0.0~1381^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9dff0bae5a266b6c41318e311c6459c9b45bf70d;p=ceph.git mds: add mds_fscrypt_last_block_max_size option support The maximum size of the last block without the header along with a truncate request when the fscrypt is enabled. Default value is 4KB. Signed-off-by: Xiubo Li --- diff --git a/src/common/options/mds.yaml.in b/src/common/options/mds.yaml.in index cfe678ed464d..4d12d5aad8ab 100644 --- a/src/common/options/mds.yaml.in +++ b/src/common/options/mds.yaml.in @@ -11,6 +11,16 @@ options: - mds flags: - runtime +- name: mds_fscrypt_last_block_max_size + type: size + level: advanced + desc: maximum size of the last block without the header along with a truncate + request when the fscrypt is enabled. + default: 4_K + services: + - mds + flags: + - runtime - name: mds_valgrind_exit type: bool level: dev diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 31d8f216b7fc..628241d754da 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -1259,6 +1259,9 @@ void Server::handle_conf_change(const std::set& changed) { if (changed.count("mds_alternate_name_max")) { alternate_name_max = g_conf().get_val("mds_alternate_name_max"); } + if (changed.count("mds_fscrypt_last_block_max_size")) { + fscrypt_last_block_max_size = g_conf().get_val("mds_fscrypt_last_block_max_size"); + } if (changed.count("mds_dir_max_entries")) { dir_max_entries = g_conf().get_val("mds_dir_max_entries"); dout(20) << __func__ << " max entries per directory changed to " diff --git a/src/mds/Server.h b/src/mds/Server.h index 76f38717c726..13e3d66d14c7 100644 --- a/src/mds/Server.h +++ b/src/mds/Server.h @@ -475,6 +475,7 @@ private: double caps_throttle_retry_request_timeout; size_t alternate_name_max = g_conf().get_val("mds_alternate_name_max"); + size_t fscrypt_last_block_max_size = g_conf().get_val("mds_fscrypt_last_block_max_size"); }; static inline constexpr auto operator|(Server::RecallFlags a, Server::RecallFlags b) {