From b6e5c080a273dfbc679a2db2772f8b58f72bc517 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 9 Jun 2011 16:53:22 -0700 Subject: [PATCH] mds: fix up MDCache::path_is_mine to remove a totally bogus assert. Signed-off-by: Greg Farnum --- src/mds/MDCache.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index e1f143ef1f433..21c82915b182d 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6700,6 +6700,13 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, Context *fin, // wh return 0; } +/** + * Find out if the MDS is auth for a given path. + * + * Returns true if: + * 1) The full path DNE and we are auth for the deepest existing piece + * 2) We are auth for the inode linked to by the last dentry. + */ bool MDCache::path_is_mine(filepath& path) { dout(15) << "path_is_mine " << path.get_ino() << " " << path << dendl; @@ -6718,7 +6725,8 @@ bool MDCache::path_is_mine(filepath& path) CDentry::linkage_t *dnl = dn->get_linkage(); if (!dn || dnl->is_null()) return dir->is_auth(); - assert(dnl->is_primary()); + if (!dnl->is_primary()) + return false; cur = dnl->get_inode(); } -- 2.39.5