From ad3da11510a268c019358a25fa90d8b38836bf7d Mon Sep 17 00:00:00 2001 From: "Yan, Zheng" Date: Mon, 17 Oct 2016 14:19:34 +0800 Subject: [PATCH] mds: check inode's parent dentry name in inode_backtrace_t::compare Signed-off-by: Yan, Zheng --- src/mds/inode_backtrace.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mds/inode_backtrace.cc b/src/mds/inode_backtrace.cc index 37c052982e9a..14286f27e90b 100644 --- a/src/mds/inode_backtrace.cc +++ b/src/mds/inode_backtrace.cc @@ -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) -- 2.47.3