From 6ea85b3f8e787d341b49d75f7df5003300d8c4c3 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Thu, 21 Sep 2017 10:56:07 +0800 Subject: [PATCH] mds: check ongoing catter-gather process before capping log When deactivating mds, MDLog::trim() may start scatter-gather process on mdsdir inode. Locker::scatter_writebehind() submits log entry. So mds should make sure there is no scatter-gather before capping log. Fixes: http://tracker.ceph.com/issues/21467 Signed-off-by: "Yan, Zheng" --- src/mds/MDCache.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index ef6263dbd77..17e3c4323aa 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7603,12 +7603,6 @@ bool MDCache::shutdown_pass() assert(!migrator->is_exporting()); assert(!migrator->is_importing()); - if ((myin && myin->is_auth_pinned()) || - (mydir && mydir->is_auth_pinned())) { - dout(7) << "still have auth pinned objects" << dendl; - return false; - } - // flush what we can from the log mds->mdlog->trim(0); if (mds->mdlog->get_num_segments() > 1) { @@ -7616,6 +7610,12 @@ bool MDCache::shutdown_pass() return false; } + if ((myin && myin->is_auth_pinned()) || + (mydir && mydir->is_auth_pinned())) { + dout(7) << "still have auth pinned objects" << dendl; + return false; + } + // (only do this once!) if (!mds->mdlog->is_capped()) { dout(7) << "capping the log" << dendl; -- 2.39.5