]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: check inode's parent dentry name in inode_backtrace_t::compare
authorYan, Zheng <zyan@redhat.com>
Mon, 17 Oct 2016 06:19:34 +0000 (14:19 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 17 Oct 2016 06:24:31 +0000 (14:24 +0800)
Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/mds/inode_backtrace.cc

index 37c052982e9a0be6b103274443703b8f09d274c8..14286f27e90bf9b805a034c29fa4e3559df35c18 100644 (file)
@@ -130,7 +130,8 @@ int inode_backtrace_t::compare(const inode_backtrace_t& other,
     comparator = 1;
   else if (ancestors[0].version < other.ancestors[0].version)
     comparator = -1;
-  if (ancestors[0].dirino != other.ancestors[0].dirino)
+  if (ancestors[0].dirino != other.ancestors[0].dirino ||
+      ancestors[0].dname != other.ancestors[0].dname)
     *divergent = true;
   for (int i = 1; i < min_size; ++i) {
     if (*divergent) {
@@ -140,7 +141,8 @@ int inode_backtrace_t::compare(const inode_backtrace_t& other,
        */
       break;
     }
-    if (ancestors[i].dirino != other.ancestors[i].dirino) {
+    if (ancestors[i].dirino != other.ancestors[i].dirino ||
+        ancestors[i].dname != other.ancestors[i].dname) {
       *equivalent = false;
       if (ancestors[i-1].version < other.ancestors[i-1].version) {
         if (comparator > 0)