]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix invalid comparison.
authorGreg Farnum <gregf@hq.newdream.net>
Wed, 25 Aug 2010 19:04:53 +0000 (12:04 -0700)
committerGreg Farnum <gregf@hq.newdream.net>
Wed, 25 Aug 2010 19:06:08 +0000 (12:06 -0700)
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.

src/mds/Server.cc

index 21b68bdd85361c224e59ddd9bec7d35fa08189c3..403c501aedeecb10a300ee95de72e439d60d3203 100644 (file)
@@ -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)