From: Greg Farnum Date: Wed, 25 Aug 2010 19:04:53 +0000 (-0700) Subject: mds: fix invalid comparison. X-Git-Tag: v0.22~221 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=655199a4821750b8292d791ec47a90dc185f4f5a;p=ceph.git mds: fix invalid comparison. We just want the code in this if block to execute if the previous if block did. But the previous if block unlinked destdnl, so the comparison always fails! Use a bool and set it appropriately to fix. --- diff --git a/src/mds/Server.cc b/src/mds/Server.cc index 21b68bdd85361..403c501aedeec 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -4902,7 +4902,9 @@ void Server::_rename_apply(MDRequest *mdr, CDentry *srcdn, CDentry *destdn, CDen // target inode if (!linkmerge && oldin) { + bool dest_primary = false; if (destdnl->is_primary()) { + dest_primary = true; assert(straydn); dout(10) << "straydn is " << *straydn << dendl; destdn->get_dir()->unlink_inode(destdn); @@ -4918,7 +4920,7 @@ void Server::_rename_apply(MDRequest *mdr, CDentry *srcdn, CDentry *destdn, CDen destdn->get_dir()->unlink_inode(destdn); } // nlink-- targeti - if (oldin->is_auth() && destdnl->is_primary()) { + if (oldin->is_auth() && dest_primary) { bool hadrealm = (oldin->snaprealm ? true : false); oldin->pop_and_dirty_projected_inode(mdr->ls); if (oldin->snaprealm && !hadrealm)