diff --git a/src/mds/CInode.h b/src/mds/CInode.h index c6f7ad9d196..ab3613c27ad 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -652,6 +652,9 @@ private: void finish_export(utime_t now); void abort_export() { put(PIN_TEMPEXPORTING); + assert(state_test(STATE_EXPORTINGCAPS)); + state_clear(STATE_EXPORTINGCAPS); + put(PIN_EXPORTINGCAPS); } void decode_import(bufferlist::iterator& p, LogSegment *ls); diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index aa1b88f7a08..046eff57332 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -920,6 +920,8 @@ void Migrator::encode_export_inode(CInode *in, bufferlist& enc_state, void Migrator::encode_export_inode_caps(CInode *in, bufferlist& bl, map& exported_client_map) { + dout(20) << "encode_export_inode_caps " << *in << dendl; + // encode caps map cap_map; in->export_client_caps(cap_map); @@ -937,6 +939,8 @@ void Migrator::encode_export_inode_caps(CInode *in, bufferlist& bl, void Migrator::finish_export_inode_caps(CInode *in) { + dout(20) << "finish_export_inode_caps " << *in << dendl; + in->state_clear(CInode::STATE_EXPORTINGCAPS); in->put(CInode::PIN_EXPORTINGCAPS); @@ -1225,7 +1229,8 @@ void Migrator::export_reverse(CDir *dir) dir->abort_export(); for (CDir::map_t::iterator p = dir->items.begin(); p != dir->items.end(); ++p) { p->second->abort_export(); - if (!p->second->get_linkage()->is_primary()) continue; + if (!p->second->get_linkage()->is_primary()) + continue; CInode *in = p->second->get_linkage()->get_inode(); in->abort_export(); if (in->is_dir()) @@ -1895,6 +1900,7 @@ void Migrator::import_reverse(CDir *dir) p != import_caps[dir].end(); ++p) { CInode *in = p->first; + dout(20) << " reexporting caps on " << *in << dendl; /* * bleh.. just export all caps for this inode. the auth mds * will pick them up during recovery.