From: Yan, Zheng Date: Mon, 17 Oct 2016 07:04:15 +0000 (+0800) Subject: mds: initialize 'equivalent' argument of inode_backtrace_t::compare X-Git-Tag: v11.1.0~516^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b7100de815a1325a484588ae4bba31f76d887daa;p=ceph.git mds: initialize 'equivalent' argument of inode_backtrace_t::compare caller of inode_backtrace_t::compare does not initialize it Signed-off-by: Yan, Zheng --- diff --git a/src/mds/inode_backtrace.cc b/src/mds/inode_backtrace.cc index 14286f27e90b..c6023dfa48e9 100644 --- a/src/mds/inode_backtrace.cc +++ b/src/mds/inode_backtrace.cc @@ -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; }