]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: journal parents of srci when srcdn is remote
authorSage Weil <sage@newdream.net>
Thu, 2 Jun 2011 22:13:42 +0000 (15:13 -0700)
committerSage Weil <sage@newdream.net>
Thu, 2 Jun 2011 22:13:42 +0000 (15:13 -0700)
If srcdn is a remote dentry, we will be journaling the src inode to update
the mtime, but we need to ensure the parent dirs are in the metablob.

Fixes: #1132
Signed-off-by: Sage Weil <sage@newdream.net>
src/mds/Server.cc

index d9596af818ab2c9e792698a1c72760647f741295..2e479f11ed3a918b7abdf31439514abe93bc339b 100644 (file)
@@ -5170,7 +5170,8 @@ 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);
+    mdcache->predirty_journal_parents(mdr, metablob, destdnl->get_inode(), straydn->get_dir(),
+                                     PREDIRTY_PRIMARY|PREDIRTY_DIR, 1);
   }
   
   // move srcdn
@@ -5210,6 +5211,7 @@ void Server::_rename_prepare(MDRequest *mdr,
        destdn->first = MAX(destdn->first, next_dest_snap);
       metablob->add_remote_dentry(destdn, true, srcdnl->get_remote_ino(), srcdnl->get_remote_d_type());
       if (srci->is_auth()) {
+       metablob->add_dir_context(srci->get_parent_dir());
        mdcache->journal_cow_dentry(mdr, metablob, srci->get_parent_dn(), CEPH_NOSNAP, 0, srcdnl);
        ji = metablob->add_primary_dentry(srci->get_parent_dn(), true, srci);
       }