From 616ff502643d8546051f0bac7635123b8a335f8b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 7 Jul 2011 11:47:52 -0700 Subject: [PATCH] mds: conclude ENOENT during travrse if we have a readable null dentry Only if the lock is readable. For example, replicas with dn lock state of LOCK aren't readable. Signed-off-by: Sage Weil --- src/mds/MDCache.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mds/MDCache.cc b/src/mds/MDCache.cc index 1418744c05ed6..57439a148da89 100644 --- a/src/mds/MDCache.cc +++ b/src/mds/MDCache.cc @@ -6523,6 +6523,12 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, Context *fin, // wh return 1; } + // can we conclude ENOENT? + if (dnl->is_null() && dn->lock.can_read(client)) { + dout(12) << "traverse: miss on null+readable dentry " << path[depth] << " " << *dn << dendl; + return -ENOENT; + } + if (dnl && !dnl->is_null()) { CInode *in = dnl->get_inode(); @@ -6605,8 +6611,7 @@ int MDCache::path_traverse(MDRequest *mdr, Message *req, Context *fin, // wh dout(20) << " didn't traverse full path; not returning pdnvec" << dendl; dn = NULL; } else if (dn) { - dout(20) << " had null " << *dn << dendl; - assert(dnl->is_null()); + assert(0); // should have fallen out in ->is_null() check above } else if (curdir->is_frozen()) { dout(20) << " not adding null to frozen dir " << dendl; } else if (snapid < CEPH_MAXSNAP) { -- 2.39.5