From: Yan, Zheng Date: Thu, 21 Sep 2017 02:56:07 +0000 (+0800) Subject: mds: check ongoing catter-gather process before capping log X-Git-Tag: v12.2.1~10^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=97ab78548d26f980ead8dc5c986304d2cfd3568d;p=ceph.git 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" --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index c4683f294add..a2510f989819 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -7629,12 +7629,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) { @@ -7642,6 +7636,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;