]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix parent check in MDCache::eval_remote
authorJohn Spray <john.spray@redhat.com>
Wed, 25 Feb 2015 10:55:42 +0000 (10:55 +0000)
committerJohn Spray <john.spray@redhat.com>
Fri, 20 Mar 2015 12:32:47 +0000 (12:32 +0000)
This code path wasn't touched until the change
in "mds/Server: fix stray reintegration".  Now we
see that it will crash in fsstress in some circumstances
when the client is doing a link operation, where
we are checking the projected linkage on the DN
before going into this function, but not the projected
parenthood of the inode.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/MDCache.cc

index 8633c28d24e06364588b92ce068cb2c9fca5a7ac..9700c930dfa8ef8d97e60c77e41d3370c13271d2 100644 (file)
@@ -9123,13 +9123,13 @@ void MDCache::eval_remote(CDentry *remote_dn)
   }
 
   // refers to stray?
-  if (in->get_parent_dn()->get_dir()->get_inode()->is_stray()) {
-    CDentry *stray_dn = in->get_parent_dn();
-
+  CDentry *primary_dn = in->get_projected_parent_dn();
+  assert(primary_dn != NULL);
+  if (primary_dn->get_dir()->get_inode()->is_stray()) {
     if (in->is_auth()) {
       dout(20) << __func__ << ": have auth for inode, evaluating" << dendl;
 
-      stray_manager.eval_remote_stray(stray_dn, remote_dn);
+      stray_manager.eval_remote_stray(primary_dn, remote_dn);
     } else {
       dout(20) << __func__ << ": do not have auth for inode, migrating " << dendl;
       /*
@@ -9143,7 +9143,7 @@ void MDCache::eval_remote(CDentry *remote_dn)
        * to <me> when <I> handle a client request with a trace referring
        * to a stray inode on another MDS.
        */
-      stray_manager.migrate_stray(stray_dn, mds->get_nodeid());
+      stray_manager.migrate_stray(primary_dn, mds->get_nodeid());
     }
   } else {
     dout(20) << __func__ << ": inode's primary dn not stray" << dendl;