diff --git a/qa/tasks/cephfs/test_exports.py b/qa/tasks/cephfs/test_exports.py index 7cbf464a953..0fe9c473919 100644 --- a/qa/tasks/cephfs/test_exports.py +++ b/qa/tasks/cephfs/test_exports.py @@ -13,9 +13,8 @@ class TestExports(CephFSTestCase): for i in range(timeout/pause): subtrees = self.fs.mds_asok(["get", "subtrees"], mds_id=status.get_rank(self.fs.id, rank)['name']) subtrees = filter(lambda s: s['dir']['path'].startswith('/'), subtrees) - log.info(subtrees) filtered = sorted([(s['dir']['path'], s['auth_first']) for s in subtrees]) - log.info(filtered) + log.info("%s =?= %s", filtered, test) if filtered == test: return subtrees time.sleep(pause) diff --git a/src/mds/CInode.h b/src/mds/CInode.h index a446bebb8cf..030c86e62a1 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -1068,9 +1068,8 @@ public: projected_parent.pop_front(); } -private: - void maybe_export_pin(bool update=false); public: + void maybe_export_pin(bool update=false); void set_export_pin(mds_rank_t rank); mds_rank_t get_export_pin(bool inherit=true) const; bool is_exportable(mds_rank_t dest) const; diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index e954038de13..c3f80715601 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -755,11 +755,11 @@ void Migrator::get_export_lock_set(CDir *dir, set& locks) } -class C_M_ExportTargetWait : public MigratorContext { +class C_M_ExportDirWait : public MigratorContext { MDRequestRef mdr; int count; public: - C_M_ExportTargetWait(Migrator *m, MDRequestRef mdr, int count) + C_M_ExportDirWait(Migrator *m, MDRequestRef mdr, int count) : MigratorContext(m), mdr(mdr), count(count) {} void finish(int r) override { mig->dispatch_export_dir(mdr, count); @@ -884,13 +884,13 @@ void Migrator::dispatch_export_dir(MDRequestRef& mdr, int count) export_try_cancel(dir); return; } - mds->wait_for_mdsmap(mds->mdsmap->get_epoch(), new C_M_ExportTargetWait(this, mdr, count+1)); + mds->wait_for_mdsmap(mds->mdsmap->get_epoch(), new C_M_ExportDirWait(this, mdr, count+1)); return; } if (!dir->inode->get_parent_dn()) { dout(7) << "waiting for dir to become stable before export: " << *dir << dendl; - dir->add_waiter(CDir::WAIT_CREATED, new C_M_ExportTargetWait(this, mdr, 1)); + dir->add_waiter(CDir::WAIT_CREATED, new C_M_ExportDirWait(this, mdr, 1)); return; } diff --git a/src/mds/journal.cc b/src/mds/journal.cc index a65b45725a8..f7570c68ab2 100644 --- a/src/mds/journal.cc +++ b/src/mds/journal.cc @@ -549,6 +549,7 @@ void EMetaBlob::fullbit::update_inode(MDSRank *mds, CInode *in) { in->inode = inode; in->xattrs = xattrs; + in->maybe_export_pin(); if (in->inode.is_dir()) { if (!(in->dirfragtree == dirfragtree)) { dout(10) << "EMetaBlob::fullbit::update_inode dft " << in->dirfragtree << " -> "