From 7770e1c6267cea7853a88eae9c621d4bf9ebe34a Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 7 Jun 2011 09:49:04 -0700 Subject: [PATCH] mds: rename: only add target to stray if destdn is a primary Only add target into the stray dir if we are renaming over a primary dentry. (Otherwise we aren't moving the target.) Signed-off-by: Sage Weil --- src/mds/Server.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mds/Server.cc b/src/mds/Server.cc index d54fa5d922007..9ce36aa42039f 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -5177,8 +5177,9 @@ void Server::_rename_prepare(MDRequest *mdr, if (destdn->is_auth() && !destdnl->is_null()) { mdcache->predirty_journal_parents(mdr, metablob, destdnl->get_inode(), destdn->get_dir(), (destdnl->is_primary() ? PREDIRTY_PRIMARY:0)|predirty_dir, -1); - mdcache->predirty_journal_parents(mdr, metablob, destdnl->get_inode(), straydn->get_dir(), - PREDIRTY_PRIMARY|PREDIRTY_DIR, 1); + if (destdnl->is_primary()) + mdcache->predirty_journal_parents(mdr, metablob, destdnl->get_inode(), straydn->get_dir(), + PREDIRTY_PRIMARY|PREDIRTY_DIR, 1); } // move srcdn -- 2.39.5