From 69f042231056071dee16ed49aad95eaa3b0447f6 Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Tue, 29 Aug 2017 11:35:56 +0800 Subject: [PATCH] mds: void sending cap import message when inode is frozen To export an inode to other mds, mds need to: - Freeze the inode (stop issuing caps to clients) - Flush client sessions (ensure client have received all cap messages) - Send cap export message These steps guarantee that clients receive cap import/export messages in proper order (In the case that inode gets exported servel times within a short time) When inode is frozen, mds may have already flushed client sessions. So mds shouldn't send cap import messages. Signed-off-by: "Yan, Zheng" (cherry picked from commit 48a9e695e58ac15f1e494977e0db7a164bb2fe98) --- src/mds/Migrator.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index d1ab1d120b03..6603e4f1a966 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -3264,8 +3264,9 @@ void Migrator::handle_export_caps(MExportCaps *ex) assert(in->is_auth()); // FIXME - if (in->is_frozen()) + if (!in->can_auth_pin()) return; + in->auth_pin(this); C_M_LoggedImportCaps *finish = new C_M_LoggedImportCaps( this, in, mds_rank_t(ex->get_source().num())); @@ -3306,4 +3307,5 @@ void Migrator::logged_import_caps(CInode *in, // clients will release caps from the exporter when they receive the cap import message. finish_import_inode_caps(in, from, false, peer_exports[in], imported_caps); mds->locker->eval(in, CEPH_CAP_LOCKS, true); + in->auth_unpin(this); } -- 2.47.3