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).
This commit is contained in:
Sage Weil 2010-05-22 09:56:27 -07:00
parent bf1cb87d25
commit f7708dea1f

View File

@ -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);
}
}
}