@@ -439,23 +439,18 @@ void CDentry::decode_replica(bufferlist::iterator& p, bool is_new)
inodeno_t rino;
unsigned char rdtype;
+ __s32 ls;
::decode(rino, p);
::decode(rdtype, p);
- if (rino) {
- if (linkage.is_null())
- dir->link_remote_inode(this, rino, rdtype);
- else
- assert(linkage.is_remote() && linkage.remote_ino == rino);
- }
-
- __s32 ls;
::decode(ls, p);
- if (is_new)
+
+ if (is_new) {
+ if (rino)
+ dir->link_remote_inode(this, rino, rdtype);
lock.set_state(ls);
+ }
}
-
-
// ----------------------------
// locking
@@ -9150,12 +9150,11 @@ CInode *MDCache::add_replica_inode(bufferlist::iterator& p, CDentry *dn, list<Co
} else {
in->decode_replica(p, false);
dout(10) << "add_replica_inode had " << *in << dendl;
- assert(!dn || dn->get_linkage()->get_inode() == in);
}
if (dn) {
- assert(dn->get_linkage()->is_primary());
- assert(dn->get_linkage()->get_inode() == in);
+ if (!dn->get_linkage()->is_primary() || dn->get_linkage()->get_inode() != in)
+ dout(10) << "add_replica_inode different linkage in dentry " << *dn << dendl;
dn->get_dir()->take_ino_waiting(in->ino(), finished);
}