From: John Spray Date: Wed, 25 Feb 2015 10:55:42 +0000 (+0000) Subject: mds: fix parent check in MDCache::eval_remote X-Git-Tag: v9.0.0~115^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3a0caf9bbb5327bc09d1b8fdfec61625982489a7;p=ceph.git mds: fix parent check in MDCache::eval_remote 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 --- diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 8633c28d24e0..9700c930dfa8 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -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 when 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;