Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jewel: mds: Duplicate damage table entries #11412

Merged
1 commit merged into from Oct 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 18 additions & 10 deletions src/mds/DamageTable.cc
Expand Up @@ -46,10 +46,13 @@ bool DamageTable::notify_dentry(
return true;
}

DamageEntryRef entry = std::make_shared<DentryDamage>(
ino, frag, dname, snap_id);
dentries[DirFragIdent(ino, frag)][DentryIdent(dname, snap_id)] = entry;
by_id[entry->id] = entry;
auto key = DirFragIdent(ino, frag);
if (dentries.count(key) == 0) {
DamageEntryRef entry = std::make_shared<DentryDamage>(
ino, frag, dname, snap_id);
dentries[key][DentryIdent(dname, snap_id)] = entry;
by_id[entry->id] = entry;
}

return false;
}
Expand All @@ -72,9 +75,12 @@ bool DamageTable::notify_dirfrag(inodeno_t ino, frag_t frag)
return true;
}

DamageEntryRef entry = std::make_shared<DirFragDamage>(ino, frag);
dirfrags[DirFragIdent(ino, frag)] = entry;
by_id[entry->id] = entry;
auto key = DirFragIdent(ino, frag);
if (dirfrags.count(key) == 0) {
DamageEntryRef entry = std::make_shared<DirFragDamage>(ino, frag);
dirfrags[key] = entry;
by_id[entry->id] = entry;
}

return false;
}
Expand All @@ -85,9 +91,11 @@ bool DamageTable::notify_remote_damaged(inodeno_t ino)
return true;
}

auto entry = std::make_shared<BacktraceDamage>(ino);
remotes[ino] = entry;
by_id[entry->id] = entry;
if (remotes.count(ino) == 0) {
auto entry = std::make_shared<BacktraceDamage>(ino);
remotes[ino] = entry;
by_id[entry->id] = entry;
}

return false;
}
Expand Down