]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: initialize 'equivalent' argument of inode_backtrace_t::compare
authorYan, Zheng <zyan@redhat.com>
Mon, 17 Oct 2016 07:04:15 +0000 (15:04 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 17 Oct 2016 07:06:19 +0000 (15:06 +0800)
caller of inode_backtrace_t::compare does not initialize it

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/inode_backtrace.cc

index 14286f27e90bf9b805a034c29fa4e3559df35c18..c6023dfa48e984f6113145b3d603f0500a99b695 100644 (file)
@@ -122,6 +122,7 @@ int inode_backtrace_t::compare(const inode_backtrace_t& other,
                                bool *equivalent, bool *divergent) const
 {
   int min_size = MIN(ancestors.size(),other.ancestors.size());
+  *equivalent = true;
   *divergent = false;
   if (min_size == 0)
     return 0;
@@ -166,7 +167,7 @@ int inode_backtrace_t::compare(const inode_backtrace_t& other,
       comparator = -1;
     }
   }
-  if (!*divergent)
-    *equivalent = true;
+  if (*divergent)
+    *equivalent = false;
   return comparator;
 }