]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: journal rename source inode when rollback rename
authorYan, Zheng <zheng.z.yan@intel.com>
Fri, 9 May 2014 01:21:16 +0000 (09:21 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Sun, 18 May 2014 05:13:22 +0000 (13:13 +0800)
rename changes the source inode's ctime. rollback changes ctime back
to its original value.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/Server.cc

index e7440f021820d132243684cd6d6133f116cf4d10..2172f5cabc0f2ee440115399b0602b02f41b192f 100644 (file)
@@ -7055,6 +7055,12 @@ void Server::do_rename_rollback(bufferlist &rbl, int master, MDRequestRef& mdr,
       le->commit.add_remote_dentry(srcdn, true);
   }
 
+  if (!rollback.orig_src.ino && // remote linkage
+      in && in->authority().first == whoami) {
+    le->commit.add_dir_context(in->get_projected_parent_dir());
+    le->commit.add_primary_dentry(in->get_projected_parent_dn(), in, true);
+  }
+
   if (force_journal_dest) {
     assert(rollback.orig_dest.ino);
     le->commit.add_dir_context(destdir);
@@ -7063,7 +7069,7 @@ void Server::do_rename_rollback(bufferlist &rbl, int master, MDRequestRef& mdr,
 
   // slave: no need to journal straydn
 
-  if (target && target->authority().first == whoami) {
+  if (target && target != in && target->authority().first == whoami) {
     assert(rollback.orig_dest.remote_ino);
     le->commit.add_dir_context(target->get_projected_parent_dir());
     le->commit.add_primary_dentry(target->get_projected_parent_dn(), target, true);