From b86d304a65d4e206ec6397573ac30d597ac59f9c Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 22 Jan 2019 12:12:55 -0800 Subject: [PATCH] mds: trim cache after journal flush Dropping cache should trim the cache only after journal flush otherwise dirty inodes will remain pinned in cache. Fixes: http://tracker.ceph.com/issues/38010 Signed-off-by: Patrick Donnelly (cherry picked from commit d7f6c1583b4162fade434e376176f3068472f53f) --- src/mds/MDSRank.cc | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index 325dc6cab9baf..fc2d9d14e304d 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -347,18 +347,6 @@ private: f->close_section(); // we can still continue after recall timeout - trim_cache(); - } - - void trim_cache() { - dout(20) << __func__ << dendl; - - if (!mdcache->trim(UINT64_MAX)) { - cmd_err(f, "failed to trim cache"); - complete(-EINVAL); - return; - } - flush_journal(); } @@ -388,6 +376,18 @@ private: f->dump_string("message", ss.str()); f->close_section(); + trim_cache(); + } + + void trim_cache() { + dout(20) << __func__ << dendl; + + if (!mdcache->trim(UINT64_MAX)) { + cmd_err(f, "failed to trim cache"); + complete(-EINVAL); + return; + } + cache_status(); } -- 2.39.5