]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: rename: only add target to stray if destdn is a primary
authorSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 16:49:04 +0000 (09:49 -0700)
committerSage Weil <sage.weil@dreamhost.com>
Tue, 7 Jun 2011 16:49:04 +0000 (09:49 -0700)
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 <sage.weil@dreamhost.com>
src/mds/Server.cc

index d54fa5d922007ce871d2ff86b350cbe64a3170af..9ce36aa42039ff0731d9e715a24dd6e02e269d28 100644 (file)
@@ -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