From f7708dea1f2db5d3be31ddc2aaf1500e1d50746d Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Sat, 22 May 2010 09:56:27 -0700 Subject: [PATCH] uclient: don't unlink null dentry when getting null linkage in mds reply This broke semi-recently when the mds started returning null linkages (and associated leases). --- src/client/Client.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index e78be951aaf..4e1c49d395a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -645,7 +645,8 @@ Inode* Client::insert_trace(MetaRequest *request, utime_t from, int mds) Dentry *dn = NULL; if (diri->dir && diri->dir->dentries.count(dname)) { dn = diri->dir->dentries[dname]; - unlink(dn, false); + if (dn->inode) + unlink(dn, false); } } } else if (reply->head.op == CEPH_MDS_OP_LOOKUPSNAP || @@ -669,7 +670,8 @@ Inode* Client::insert_trace(MetaRequest *request, utime_t from, int mds) Dentry *dn = NULL; if (diri->dir && diri->dir->dentries.count(dname)) { dn = diri->dir->dentries[dname]; - unlink(dn, false); + if (dn->inode) + unlink(dn, false); } } }