]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: void sending cap import message when inode is frozen 17854/head
authorYan, Zheng <zyan@redhat.com>
Tue, 29 Aug 2017 03:35:56 +0000 (11:35 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 21 Sep 2017 03:34:40 +0000 (11:34 +0800)
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" <zyan@redhat.com>
(cherry picked from commit 48a9e695e58ac15f1e494977e0db7a164bb2fe98)

src/mds/Migrator.cc

index d1ab1d120b03baeff89f991f79252da2728c5c79..6603e4f1a96662a6806214aa69509bc9b5ef723a 100644 (file)
@@ -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);
 }