Skip to content

Commit becedf2

Browse files
committed
Merge PR ceph#57354 into main
* refs/pull/57354/head: mds: relax divergent backtrace scrub failures for replicated ancestor inodes Reviewed-by: Kotresh Hiremath Ravishankar <[email protected]> Reviewed-by: Patrick Donnelly <[email protected]> Reviewed-by: Milind Changire <[email protected]>
2 parents 75bcfd1 + b98bb86 commit becedf2

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/mds/CInode.cc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,6 +1005,19 @@ bool CInode::is_ancestor_of(const CInode *other, std::unordered_map<CInode const
10051005
return false;
10061006
}
10071007

1008+
bool CInode::is_any_ancestor_inode_a_replica() {
1009+
CDentry *pdn = get_parent_dn();
1010+
while (pdn) {
1011+
CInode *diri = pdn->get_dir()->get_inode();
1012+
if (!diri->is_auth()) {
1013+
return true;
1014+
}
1015+
pdn = diri->get_parent_dn();
1016+
}
1017+
1018+
return false;
1019+
}
1020+
10081021
bool CInode::is_projected_ancestor_of(const CInode *other) const
10091022
{
10101023
while (other) {
@@ -4835,7 +4848,11 @@ void CInode::validate_disk_state(CInode::validated_data *results,
48354848
dout(20) << "divergent backtraces are acceptable when dn "
48364849
"is being purged or has been renamed or moved to a "
48374850
"different directory " << *in << dendl;
4838-
}
4851+
} else if (in->is_any_ancestor_inode_a_replica()) {
4852+
results->backtrace.passed = true;
4853+
dout(20) << "divergent backtraces are acceptable when some "
4854+
"ancestor inodes are replicas " << *in << dendl;
4855+
}
48394856
} else {
48404857
results->backtrace.passed = true;
48414858
}

src/mds/CInode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,8 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counter<CIno
707707
const CDir *get_projected_parent_dir() const;
708708
CDir *get_projected_parent_dir();
709709
CInode *get_parent_inode();
710+
711+
bool is_any_ancestor_inode_a_replica();
710712

711713
bool is_lt(const MDSCacheObject *r) const override {
712714
const CInode *o = static_cast<const CInode*>(r);

0 commit comments

Comments
 (0)