diff options
author | Yan, Zheng <zheng.z.yan@intel.com> | 2013-01-27 15:22:46 +0800 |
---|---|---|
committer | Yan, Zheng <zheng.z.yan@intel.com> | 2013-01-29 10:17:37 +0800 |
commit | 5884177667b9c5ca61236e5ee375b499d69b4f11 (patch) | |
tree | fdc530d29a578f27e7e419256c7f474fad82e4d8 | |
parent | abc4c78550946a5640c0c8ea912e990557718521 (diff) | |
download | ceph-5884177667b9c5ca61236e5ee375b499d69b4f11.tar.gz |
mds: mark export bounds for cross authority directory rename
this guarantees that the importing MDS gets directory fragment's
up-to-date fragstat/rstat.
Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
-rw-r--r-- | src/mds/Server.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 04bcba71229..00e7f77b42a 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -6322,11 +6322,22 @@ void Server::_logged_slave_rename(MDRequest *mdr, // export srci? if (srcdn->is_auth() && srcdnl->is_primary()) { - list<Context*> finished; + // set export bounds for CInode::encode_export() + list<CDir*> bounds; + if (srcdnl->get_inode()->is_dir()) { + srcdnl->get_inode()->get_dirfrags(bounds); + for (list<CDir*>::iterator p = bounds.begin(); p != bounds.end(); p++) + (*p)->state_set(CDir::STATE_EXPORTBOUND); + } + map<client_t,entity_inst_t> exported_client_map; bufferlist inodebl; mdcache->migrator->encode_export_inode(srcdnl->get_inode(), inodebl, exported_client_map); + + for (list<CDir*>::iterator p = bounds.begin(); p != bounds.end(); ++p) + (*p)->state_clear(CDir::STATE_EXPORTBOUND); + ::encode(exported_client_map, reply->inode_export); reply->inode_export.claim_append(inodebl); reply->inode_export_v = srcdnl->get_inode()->inode.version; |