]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: do not reintegrate stray if target dentry is projected
authorSage Weil <sage@newdream.net>
Fri, 16 Jan 2009 23:06:34 +0000 (15:06 -0800)
committerSage Weil <sage@newdream.net>
Fri, 16 Jan 2009 23:06:34 +0000 (15:06 -0800)
Otherwise we break user semantics.  Remote parent might be
unlinking!  Then we move the file back into the position that
was just unlinked...

src/mds/MDCache.cc

index cc097e88a18044ff87f6a64257acce1f1720bb5e..27e72f42755762eac05b0ca6b2ee1c763e389513 100644 (file)
@@ -6479,11 +6479,16 @@ void MDCache::eval_stray(CDentry *dn)
     // trivial reintegrate?
     if (!in->remote_parents.empty()) {
       CDentry *rlink = *in->remote_parents.begin();
-      if (rlink->is_auth() && rlink->dir->can_auth_pin())
-       reintegrate_stray(dn, rlink);
       
-      if (!rlink->is_auth() && dn->is_auth())
-       migrate_stray(dn, mds->get_nodeid(), rlink->authority().first);
+      // don't do anything if the remote parent is projected, or we may
+      // break user-visible semantics!
+      if (!rlink->is_projected()) {
+       if (rlink->is_auth() && rlink->dir->can_auth_pin())
+         reintegrate_stray(dn, rlink);
+       
+       if (!rlink->is_auth() && dn->is_auth())
+         migrate_stray(dn, mds->get_nodeid(), rlink->authority().first);
+      }
     }
   } else {
     // wait for next use.