Skip to content

Commit

Permalink
Merge PR ceph#25220 into master
Browse files Browse the repository at this point in the history
* refs/pull/25220/head:
	mds: queue inodes into MDCache::export_pin_queue after setattr is journaled

Reviewed-by: Patrick Donnelly <[email protected]>
  • Loading branch information
batrick committed Dec 12, 2018
2 parents 3b21c53 + 93cbee3 commit 5661662
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
13 changes: 7 additions & 6 deletions src/mds/CInode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,10 @@ void CInode::pop_and_dirty_projected_inode(LogSegment *ls)
int64_t old_pool = inode.layout.pool_id;

mark_dirty(front.inode.version, ls);
bool new_export_pin = inode.export_pin != front.inode.export_pin;
inode = front.inode;
if (new_export_pin)
maybe_export_pin(true);

if (inode.is_backtrace_updated())
mark_dirty_parent(ls, old_pool != inode.layout.pool_id);
Expand Down Expand Up @@ -4858,7 +4861,6 @@ void CInode::set_export_pin(mds_rank_t rank)
ceph_assert(is_dir());
ceph_assert(is_projected());
get_projected_inode()->export_pin = rank;
maybe_export_pin(true);
}

mds_rank_t CInode::get_export_pin(bool inherit) const
Expand All @@ -4872,15 +4874,14 @@ mds_rank_t CInode::get_export_pin(bool inherit) const
while (true) {
if (in->is_system())
break;
const CDentry *pdn = in->get_projected_parent_dn();
const CDentry *pdn = in->get_parent_dn();
if (!pdn)
break;
const mempool_inode *pi = in->get_projected_inode();
// ignore export pin for unlinked directory
if (pi->nlink == 0)
if (in->get_inode().nlink == 0)
break;
if (pi->export_pin >= 0)
return pi->export_pin;
if (in->get_inode().export_pin >= 0)
return in->get_inode().export_pin;

if (!inherit)
break;
Expand Down
1 change: 1 addition & 0 deletions src/mds/CInode.h
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,7 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter<CIno
int d_type() const { return IFTODT(inode.mode); }

mempool_inode& get_inode() { return inode; }
const mempool_inode& get_inode() const { return inode; }
CDentry* get_parent_dn() { return parent; }
const CDentry* get_parent_dn() const { return parent; }
CDentry* get_projected_parent_dn() { return !projected_parent.empty() ? projected_parent.back() : parent; }
Expand Down
2 changes: 0 additions & 2 deletions src/mds/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6699,8 +6699,6 @@ void Server::_unlink_local(MDRequestRef& mdr, CDentry *dn, CDentry *straydn)
if (in->is_dir()) {
ceph_assert(straydn);
mdcache->project_subtree_rename(in, dn->get_dir(), straydn->get_dir());

in->maybe_export_pin(true);
}

journal_and_reply(mdr, 0, dn, le, new C_MDS_unlink_local_finish(this, mdr, dn, straydn));
Expand Down

0 comments on commit 5661662

Please sign in to comment.