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)
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()));
// 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);
}