From d2fe39542452698f545f698bb725e8e3b94d8f56 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Mon, 25 Oct 2021 15:18:03 +0800 Subject: [PATCH] mds: do not trim cache when creating system file Fixes: https://tracker.ceph.com/issues/51023 Signed-off-by: Xiubo Li (cherry picked from commit 138fea6a7638697acb1a9e824db7b8d04ad8d671) --- src/mds/MDCache.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 2e7cad369ba69..adf46a839e61e 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -13358,7 +13358,9 @@ void MDCache::upkeep_main(void) if (active_with_clients) { trim_client_leases(); } - trim(); + if (is_open()) { + trim(); + } if (active_with_clients) { auto recall_flags = Server::RecallFlags::ENFORCE_MAX|Server::RecallFlags::ENFORCE_LIVENESS; if (cache_toofull()) { -- 2.39.5