]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix up MDCache::path_is_mine to remove a totally bogus assert.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 9 Jun 2011 23:53:22 +0000 (16:53 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 10 Jun 2011 00:22:37 +0000 (17:22 -0700)
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mds/MDCache.cc

index e1f143ef1f4335f5fd74e7e676840407c9464d52..21c82915b182dc2cce4b45c5f783fb528d852424 100644 (file)
@@ -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();
   }