]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: make inode first track dn first on rename
authorSage Weil <sage@newdream.net>
Mon, 16 Aug 2010 23:45:14 +0000 (16:45 -0700)
committerSage Weil <sage@newdream.net>
Mon, 16 Aug 2010 23:45:14 +0000 (16:45 -0700)
This mirrors the logic in cc8f5ac47c77d1e336e16d8deb024d507e0e8c59.  Make
the renamed inode first match the destdn to avoid problems down the line.
Do this after we've (potentially) cowed the inode in the journal_cow_dentry
on srcdn.

src/mds/Server.cc

index 934df441d640b4bfb4f092acf45ccc9f01f8424d..2bde1fb03a4343ed5f0361b18eb1342b627662ef 100644 (file)
@@ -4853,6 +4853,10 @@ void Server::_rename_prepare(MDRequest *mdr,
   mdcache->journal_cow_dentry(mdr, metablob, srcdn, CEPH_NOSNAP, 0, srcdnl);
   metablob->add_null_dentry(srcdn, true);
 
+  // make renamed inode first track the dn
+  if (srcdnl->is_primary() && destdn->is_auth())
+    srcdnl->get_inode()->first = destdn->first;  
+
   // do inode updates in journal, even if we aren't auth (hmm, is this necessary?)
   if (!silent) {
     if (ji && !pi) {