summaryrefslogtreecommitdiff
path: root/src/mds/Server.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/mds/Server.cc')
-rw-r--r--src/mds/Server.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mds/Server.cc b/src/mds/Server.cc
index 92062f74f59..2fff8f3aae8 100644
--- a/src/mds/Server.cc
+++ b/src/mds/Server.cc
@@ -5800,6 +5800,13 @@ void Server::_rename_prepare(MDRequest *mdr,
// prepare nesting, mtime updates
int predirty_dir = silent ? 0:PREDIRTY_DIR;
+ // guarantee stray dir is processed first during journal replay. unlink the old inode,
+ // then link the source inode to destdn
+ if (destdnl->is_primary() && straydn->is_auth()) {
+ metablob->add_dir_context(straydn->get_dir());
+ metablob->add_dir(straydn->get_dir(), true);
+ }
+
// sub off target
if (destdn->is_auth() && !destdnl->is_null()) {
mdcache->predirty_journal_parents(mdr, metablob, oldin, destdn->get_dir(),